Working with FHIR

"How do I take this concept and represent it in FHIR?"

Working with FHIR Resources can be confusing. We suggest working through the following steps to learn more about how to represent concepts using FHIR.

  1. Explore the FHIR resources that can represent this concept. Try to decide which resources would best represent the concepts you are trying to express.
  2. How are these concepts related? Look at the relationships between these fields in the FHIR Resource. Are there any references between these types?
  3. How can I get what I want? Check what search parameters you can use on your Resources. Each resource can contain many fields of the same type, so be sure to read carefully whether it’s the field you want to use.
    Read more about search parameters

Let's walk through a few of these examples...

Search for Patient by Name

  1. Explore the FHIR resources that can represent this concept.
    • Patient
    • HumanName
  2. How are these concepts related?
    • Patient.name -> HumanName
  3. How can I get what I want?
    • Patient?name=: "Returns patients with the given name.

All together we get: Patient?name={name}

Show all Patient Medications that haven’t been picked up from a pharmacy

  1. Explore the FHIR resources that can represent this concept.
    • Patient
    • Organization
    • Medication
    • MedicationRequest
  2. How are these concepts related?
    • MedicationRequest.subject -> Patient: "Who or group medication request is for"
    • MedicationRequest.dispenseRequest.performer -> Organization: "Intended dispenser"
    • MedicationRequest.medication -> Medication: "Medication to be taken"
  3. How can I get what I want?
    • MedicationRequest?patient=: "Returns prescriptions for a specific patient."
    • MedicationRequest?status=active: "Returns prescriptions where status is active"

All together we get: MedicationRequest?patient={patient}&status=active

Find tasks for a practitioner

  1. Explore the FHIR resources that can represent this concept.
    • Task
    • Practitioner
  2. How are these concepts related?
    • Task.owner -> Reference(Practitioner): "Responsible individual"
    • Task.requester -> Reference(Practitioner): "Who is asking for task to be done"
  3. How can I get what I want?
    • Task?owner=: "Search by task owner"

All together we get: Task?owner={practitioner}


Best Practices

Data Sharing & Data Safety

  • Don’t create resources that are specific just for your application, imagine that your application is part of a larger ecosystem that will share data between many applications, some of which you did not write.
  • You will come into contact with Resources that you did not create. Try to build generic instead of building out specific tags that would be just for you.
  • Be careful about modifying resources because the changes you make will exist for others, too.
  • Clean up after yourself!

Defensive Programming

  • This app may exist in many different environments, where the amount of information available can be wildly different.
  • Say you want to track lists of Patients for doctors, be aware that lists might not always contain all of the information that you expect them to.
  • Support things that don’t conform exactly to what you want. Show everything you can in your "best" view, but don’t throw away anything that doesn’t fit, create a way to view this other information.
  • Expect 405 errors, for when you try to do something that you aren’t allowed to do.