Integrating with a FHIR API

Fast Healthcare Interoperability Resources or FHIR, is a standard for exchanging healthcare information online/electronically (https://www.hl7.org/fhir/overview.html) and slowly becoming the standard for integrating applications with the medical record system.

Who’s using FHIR

EMRs are beinging to adopt to allow anyone to build an app with their data.

Cheatsheet

  • Searching
    • Sorting
      • https://fhirapi/Patient/_search?_sort=-given,_score
      • _sort=status,-date,category
      • Use _score for searching by relevance
    • Limit
      • defaults to ~100
      • https://fhirapi/Patient/_search?_count=10
    • Including additional resources (https://www.hl7.org/fhir/search.html#revinclude)
      • https://fhirapi/Patient/_search?_include=
      • _include
      • _ revinclude
    • Contained resources
      • _contained=false,true,both
    • Score
      • per entry of result
  • Resources
    • Common Attributes
      • _id
      • _lastUpdated
      • _tag
      • _profile
      • _security
      • _text
      • _content
      • _list
      • _has
      • _type
    • Restful
      • https://fhirapi/Patient/:id
    • Elements
      • https://fhirapi/Patient/:id?_elements=given
      • Select set of attributes of a resource to return
  • Pagination
    • Pointer pagination, array of links to specific pages
      "link": [
        {
            "relation": "self",
            "url": "https://baseUrl/_snapshot?id=42a67b52-870a-49a4-a851-a0dcd0953819&start=0"
        },
        {
            "relation": "first",
            "url": "https://baseUrl/_snapshot?id=42a67b52-870a-49a4-a851-a0dcd0953819&start=0"
        },
        {
            "relation": "last",
            "url": "https://baseUrl/_snapshot?id=42a67b52-870a-49a4-a851-a0dcd0953819&start=2"
        },
        {
            "relation": "next", 
            "url": "https://baseUrl/_snapshot?id=42a67b52-870a-49a4-a851-a0dcd0953819&start=1"
        }
        ]
      
  • Summary