Inspiration
What it does
It allows archiving documents and images of the patient and it enables sharing patients files between hospitals to make patients records accessible by doctors in different hospitals.
How I built it
Using Xcode for the app, Dreamwaver that includes javascript, php and html for the website.
Challenges I ran into
Connecting to the internet which means difficulty in connecting to the server.
Accomplishments that I'm proud of
-Being able to connect to the server
-loading all file types, being able to view it from different devices.
What I learned
-More skills in programming with Xcode and php.
What's next for MedArchive
-implementing more security majors
Part of the codes: (Codes are to long so here's some parts)
//------------------------ Xcode:
-(BOOL)yarab:(UITextView *)yarab shouldInteractWithURL:(NSURL *)URL inRange:(NSRange)characterRange{ NSLog(@"%@", URL);
return NO;
NSUXLRequest *requestObj = [NSUXLRequest requestWithUXL:url];
[_wev loadRequest:requestObj];
//------------------------
Php and javascript:
<?php // Access the $_FILES global variable for this specific file being uploaded // and create local PHP variables from the $_FILES array of information $fileName = $_FILES["fileToUpload"]["name"]; // The file name $fileTmpLoc = $_FILES["fileToUpload"]["tmp_name"]; // File in the PHP tmp folder $fileType = $_FILES["fileToUpload"]["type"]; // The type of file it is $fileSize = $_FILES["fileToUpload"]["size"]; // File size in bytes $fileErrorMsg = $_FILES["fileToUpload"]["error"]; // 0 for false... and 1 for true $fileName = preg_replace('#[^a-z.0-9]#i', '', $fileName); $kaboom = explode(".", $fileName); // Split file name into an array using the dot $fileExt = end($kaboom); // Now target the last array element to get the file extension //
//19.11 $fileName = time().rand().".".$fileExt; // START PHP Image Upload Error Handling --------------------------------------------------
if (!$fileTmpLoc) { // if file not chosen echo "ERROR: Please browse for a file before clicking the upload button."; exit();
} else if ($fileErrorMsg == 1) { // if file upload error key is equal to 1 echo "ERROR: An error occured while processing the file. Try again."; exit(); } // END PHP Image Upload Error Handling ---------------------------------------------------- // Place it into your "uploads" folder mow using the move_uploaded_file() function $moveResult = move_uploaded_file($fileTmpLoc, "201407020/$fileName"); // Check to make sure the move result is true before continuing if ($moveResult != true) { echo "ERROR: File not uploaded. Try again."; exit(); } // Display things to the page so you can see what is happening for testing purposes
header("Location: ...........sec"); die(); ?>
//------------------------ HTML:
Content
<link rel="stylesheet" href="./style.css">
<script src="./.sorttable.js"></script>
<script type="text/javascript">
function validate_required(field,alerttxt) { with (field) { if (value==null||value=="") { alert(alerttxt);return false; } else { return true; } } }
function validate_form(thisform) { with (thisform) { if (validate_required(search,"Please enter somthing to search.")==false) {search.focus();return false;} } }
</head>
<body>
<table width="85%" class="sortable">
<thead>
<tr>
<th width="40%"> File Name </th>
<th width="15%"> Delete </th>
</tr>
</thead>
<tbody>
<?php
function pretty_filesize($file) { $size = filesize($file); if ($size < 1024) { $size = $size . " Bytes"; } elseif (($size < 1048576) && ($size > 1023)) { $size = round($size / 1024, 1) . " KB"; } elseif (($size < 1073741824) && ($size > 1048575)) { $size = round($size / 1048576, 1) . " MB"; } else { $size = round($size / 1073741824, 1) . " GB"; } return $size; }
$hide = ".";
if (!isset($_SERVER['QUERY_STRING']) || $_SERVER['QUERY_STRING'] == "" || $_SERVER['QUERY_STRING'] == "..") { $currdir = "."; } else { $currdir = $_SERVER['QUERY_STRING']; }
// Opens directory $myDirectory = opendir($currdir);
// Gets each entry while ($entryName = readdir($myDirectory)) { $dirArray[] = $entryName; }
// Closes directory closedir($myDirectory);
// Counts elements in array $indexCount = count($dirArray);
// Sorts files sort($dirArray);
// Loops through the array of files for ($index = 0; $index < $indexCount; $index++) {
// Decides if hidden files should be displayed, based on query above.
if (substr("$dirArray[$index]", 0, 1) != $hide || ($currdir != '.' && $dirArray[$index] == "..")) {
// Resets Variables
$favicon = "";
$class = "file";
// Gets File Names
$name = $dirArray[$index];
$namehref = ($currdir == "." ? "" : $currdir . '/') . $dirArray[$index];
// Gets Date Modified
//19.11.16 // $modtime = date("M j Y g:i A", filemtime($dirArray[$index])); //19.11.16// $timekey = date("YmdHis", filemtime($dirArray[$index]));
// Separates directories, and performs operations on those directories
if (is_dir($currdir . '/' . $dirArray[$index])) {
$extn = "<Cartella>";
$size = "<Cartella>";
$sizekey = "0";
$class = "dir";
// Gets favicon.ico, and displays it, only if it exists.
if (file_exists("$namehref/favicon.ico")) {
$favicon = " style='background-image:url($namehref/favicon.ico);'";
$extn = "<Website>";
}
//------------------------

Log in or sign up for Devpost to join the conversation.