While the MedImage App is a useful tool, it is certainly not all-comprehensive, and since the MedImage Server is an open platform we encourage other developers to send files from their own apps into the MedImage Server. This provides developers with a tried and tested route for their photos (or other files) to be sent to an increasingly wide range of back-end medical systems.
Pairing Process
API Calls
From your app you can call the pairing script
https://medimage-pair.atomjump.com/med-genid.php?compare=[user's 4 letter code from MedImage Server]
Which will return a MedImage Server URL on a successful code e.g.
https://medimage-nz1.atomjump.com/write/uPSE4UWHmJ8XqFUqvf
Or on a failure:
nomatch
This should then have a multi-part https POST request done with the image or file attached, to the domain part of the URL, with “/api/photo” appended:
https://medimage-nz1.atomjump.com/api/photo
The file name should have the hash at the end of the server URL entered at the beginning to create the correct ‘bucket’ or folder in order for it to download to your server i.e.
#uPSE4UWHmJ8XqFUqvf-test.pdf
- The filename string entered into the POST request should have any spaces replaced with hyphens ‘-‘.
- A hash in front of any word from the original file-name string signifies a new folder on the server.
- The name of the file parameter itself must be called ‘file1’
Checking if a file exits
To check if a file exists (useful to see if the file has been transferred from the proxy server to the final destination), use e.g.
https://medimage-nz1.atomjump.com/read/uPSE4UWHmJ8XqFUqvf?check=test.jpg
where the file path in the check parameter should be URL encoded.
This will return either ‘true’ if it exists or ‘none’ if it doesn’t.
Testing using a browser
You can create a local .html file and open this in a local browser.
<html> <body> <form action="https://medimage-nz1.atomjump.com/api/photo" method="post" enctype="multipart/form-data"> <p><input type="file" name="file1"></p> <p><button type="submit">Submit</button></p> </form> </body> </html>
Where the action=”” is the domain part of the paired URL, with “/api/photo” appended. Rename your local file name with your own hash e.g.
#uPSE4UWHmJ8XqFUqvf-test.jpg
and then try selecting and submitting the file within the browser. You should see a
Received upload successfully!
message, if the file has gone through, and after 10 seconds, you should see the file in your target folder. If you get no visual message, or some other message, the file has not been sent correctly.
Return HTTP codes include:
Example Client
The MedImage App source code is available to browse at GitHub.