The web in a few minutes
The Health Data Exchange Map (FHIR): The web in a few minutes.
Every FHIR call is a web request
FHIR's main way of exchanging data is the web. So before the FHIR calls make sense, it helps to know three things: what an address is made of, what a request is, and what comes back. This takes a few minutes.
A URL has named parts
An address on the web is a U R I, often called a U R L. The standard breaks one down into parts. The scheme comes first, before the colon: here, https. Then the authority: the host name, which may be followed by a colon and a port number. Then the path. Then, after a question mark, an optional query. And after a hash, an optional fragment. The standard's own example address has all five; the port number is left out here to keep it short.
- https://example.com/over/there
- ?name=ferret#nose
A client asks. A server answers.
Almost everything on the web is one pattern: a client sends a request, and a server sends a response. H T T P, the protocol, is described in its standard as a family of stateless, application level request and response protocols. Stateless means each request can be understood on its own, without the server remembering earlier ones.
- A browser
- An app
- A script
- Receives requests · gear
- Sends responses · share
Ask for a record, get a record
Here is a real exchange. The request, on the left, asks for one resource: get, the path Patient slash one two three. The server, on the right, replies with a status line, two hundred O K, a header saying the content is JSON, and then the content itself: a small made up patient record. The first line of a request says what to do and where. The first line of a response says how it went.
- GET /Patient/123 HTTP/1.1
- Host: localhost
- Accept: application/json
Check yourself
Pause and think. What does the scheme part of a U R L, such as https, tell you? The answer: which protocol to use to reach the resource.
- Which protocol to use to reach the resource
- Which file the resource is saved in
- Which person owns the server
- How big the answer will be
Keep these in mind
A U R L has a scheme, an authority, a path, a query and a fragment. A client sends a request, and a server sends a response. H T T P is stateless, so each request stands alone. And the first line says what to do, or how it went.
- A URL has a scheme, an authority, a path, a query and a fragment
- A client sends a request; a server sends a response
- HTTP is stateless: each request stands alone
- The first line says what to do, or how it went
SNOMED CT®, LOINC®, ICD and other terminologies are the property of their respective owners and are shown for education under their licences. Licences & attributions