FHIR for Developers - FHIR vs HTTP

tutorial

Part 1 - RestApi/Resources - postman & HAPI

00

This tutorials uses Postman and the free server HAPI at at https://confluence.hl7.org/display/FHIR

01

Go to RESTful Api page in the 'Documentation' tab https://hl7.org/fhir/http.html

02

The Whole System Interactions occurs on the base url ex,

GET http://hapi.fhir.org/baseR4

Adding metadata at the end shows the capablities of the baseurl

GET http://hapi.fhir.org/baseR4/metadata

03

Type Level Interactions occur on the resource returned from the whole system

GET http://hapi.fhir.org/baseR4/Patient ....
                            

04

I don't get this yet it think,
Instance Level Interactions act as methods to the resource that have an id on them

https://hapi.fhir/baseR4/Patient? params instance 

05

VERB [base]/[type]/[id] {?_format=[mime-type]}
  • VERB - GET,POST,PUT, PATCH, DELETE...
  • [base] - http://hapi.fhir.org/baseR4 (example)
  • [type] Patient, imaging study, medications

Part 2 - Perfered Header / Confluence example data & OperationOutcome read

00

'prefer header'

I'm not sure if this applies to getting resources, it looks like this header is only applicable to CREATE and UPDATE, the documentation is discussed here,
https://hl7.org/fhir/http.html
and it is discussed at 6:30 in tutorial

BUT, these are the mime types

xml

XML: application/fhir+xml

json

JSON: application/fhir+json

01

USE the 'Hapi' free test Servers at,
https://confluence.hl7.org/

02

Copy and paste from https://confluence.hl7.org/display/FHIR

http://hapi.fhir.org/baseR4 

as a GET reuqest in postman

Part 3 - CapabilityStatement & SearchParameters /baseR4/metadata

01

To get the capabilities from the request, we must add metata to the end of the url

http://hapi.fhir.org/baseR4/metadata

02

 Each Resources/types can be found within the response under rest. for example, is a Resource such as Account, or Patient

03

 The documentation for resources/types, such as Patient, can be found at
https://hl7.org/fhir/patient.html#:~:text=8.1.13%20Search%20Parameters
Along with the Search parameters at the bottom

04

Also in rest is searchInclude and in patient we can find "Patient: general-practitioner"

05

The Search parameters are also located within the type inside rest, labled as searchParam

SearchParameters in the doc
https://hl7.org/fhir/patient.html
compared to the response in postman

Part 4 - CURL HEADER File Format XML vs JSON & curl

01

We can change the format from JSON to XML using an Accept: clause in the postman's workspace Header

application/fhir+xml

02

Or you can change it to

application/fhir+json

03

Override the Accept in the header by including a ? at the end of the url which will over-ride the Accept clause

http://hapi.fhir.org/baseR4/metadata?_format=application/fhir+json

04

Do the same using curl with the following,

curl --location --request GET http://hapi.fhir.org/baseR4/metadata --header 'Accept: application/fhir+json'

05

You can also make request to the server in confluence's HAPI pages,
https://hapi.fhir.org/

Part 5 - Hapi Web UI, Bundle and next page tokens

01

Click on the Web UI for Hapi's public test server
https://hapi.fhir.org/

02

The Conformance Statement is the old name for CapabilityStatement

Hapi web UI shows the same data as in postman

03

Click on the Patient Resource and click search,

04

This returns a Bundle

Part 6 - Query in Hapi Web UI

01

Get to the Hapi Web UI
https://hapi.fhir.org/
Click Patient, (double click to get search to work)

02

Enter paramters, test for name
Click Search, (double click if it doesn't work)

03

This returns a Bundle of type Patient containing the string test for name

04

  Notice the link parameter containing , relation and url
  This allows us to page through results, when available

05

Hapi's Web UI compared FHIR Documentation of Bundle
https://hl7.org/fhir/bundle.html

06

The Bundle Resource has different types,

07

We are interested in the searchSet type

08

which appears in the servers response (The Last two steps seem irrelevant, but keep going to , search by id of patient)

Part 7 - search Full URL Patient ID Bundle Vs Resource

01

Use the full UR of a Patient in request

https://hapi.fhir.org/baseR4/Patient/37

02

This code returns the Patient Resource

GET http://hapi.fhir.org/baseR4/Patient/37

02

Format reutrns the Bundle Resource

http://hapi.fhir.org/baseR4/Patient?_id=37

04

The

Part 8 Bundle Resource Extension -> 'relation' & 'url' / curl

01

The Bundle is a container with the result, and has a parameter?(right word)??
extension that has relation and url

02

Curl command to do the above examples, This page is a mess maybe go back and do after, Seach Videos Playlists

curl --location --request GET http://hapi.fhir.org/baseR4/metadata --header 'Accept: application/fhir+json'

Part 9 - POST , create a "Patient"

01

Maybe go back and do this, not related to what i have to do