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

1. The user clicks the pairing button on the MedImage Server. This does a request for a new code generated by a script that we host at atomjump.com.
2. A 4 letter pairing code (which is usable for an hour) is shown visually on the Server.
3. On your own app, the user specifies that they are connecting to a new server, and an input box appears asking for the 4 letter code.
4. Your app quizzes the hosted database at atomjump.com with that 4 letter code, and a URL is returned which uniquely (i.e. globally uniquely) corresponds with the MedImage server’s address.
5. The app stores this URL in it’s memory, and it will continue to send photos there, so no further pairing is required.

 

API Calls

From your app you can call the pairing script

https://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.

Filename String
Created in the Server target folder

#uPSE4UWHmJ8XqFUqvf-#NHID1234-#arm-wound.jpg
\NHID\arm\wound.jpg

#uPSE4UWHmJ8XqFUqvf-test.pdf
\test.pdf

Note: .pdf files are not currently supported by the https://medimage-nz1.atomjump.com/ server, which is running ver 1.4, rather than ver >= 1.5. You will need to set up your own proxy server, to test any files other than a .jpg image file.

 

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, the file has not been sent correctly.

 

Example Client

The MedImage App source code is available to browse at GitHub.