SC-SL
SC-SL

Reputation: 377

FHIR - Patient - How to upload and retrieve patient photo

FHIR Patient Resource has a photo variable:

photo 0..* Attachment Image of the patient

Questions: Are there examples for each: How do upload a patient photo (what format are supported etc). How to retrieve a patient photo?

This post How to Get FHIR Photo for Patient from a URL seems to be old.

Upvotes: 2

Views: 1643

Answers (2)

Mirjam Baltus
Mirjam Baltus

Reputation: 2299

The post you've mentioned might be a bit older, but it is still valid. You have several ways to store binary data, depending on the capabilities of your system.

You could store the base64 encoded data in the Patient.photo.data field.

You could also store the data somewhere else and then point to it with the Patient.photo.url field. So for example you store the photo on your [base]/Binary, which will give you the technical id for it. Then set Patient.photo.url to [base]/Binary/[id]. The advantage of this approach is that you can retrieve the normal patient data without the payload of the image. Disadvantage is that you might need a separate call to retrieve the image.

Upvotes: 2

Patrick Werner
Patrick Werner

Reputation: 1115

Patient.photo is an Attachment which contains Attachment.data, which is a base64Binary. So you just base64 encode the image and set the proper contentType.

I uploaded you a patient with photo here: http://fhirtest.uhn.ca/baseDstu3/Patient/70691

Upvotes: 1

Related Questions