Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
HL7 FHIR
Hands-on Training Course
Ewout Kramer
March 2015
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Who am I?
Introduction to FHIR
The Resource and REST
Exercise - Requesting a Patient resource
Deconstructing the FHIR data model
Exercise - Editing a Resource Instance
Bundles
Simple search and search demo
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
INTRODUCTION TO FHIR
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
The Acronym
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
FHIR Manifesto
Focus on implementers
Keep common scenarios simple
Leverage existing technologies
Provide human readability
Make content freely available
Demonstrate best practice governance
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Implementer Focus
XmlReader xr = XmlReader.Create(
Publicly available test servers new StreamRead
IFhirReader r = new XmlFhirReader
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
WHAT’S IN THE BOX?
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Resources
Patient Prescription
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
The 80/20 rule
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Extensibility
+ =
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
The Case for Extensions
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Transport
HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8
Content-Length: 627
Content-Location: /fhir/Patient/1/history/1
Last-Modified: Sat, 03 May 2014 16:28:55 GMT
{"resourceType":"Patient","identifier":[{"use":"usu
al","label":"MRN","system":"urn:oid:1.2.36.146.59
5.217.0.1","value":"12345","period":{"start":"2001-
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Just follow the industry...
REST Documents
Messages Services
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Regardless of paradigm
the content is the same
Lab System
National
Exchange
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Looking at FHIR Resources from a software engineering perspective
DESIGN OF THE
RESOURCE
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Resources
“Resources” are:
Small logically discrete units of exchange
Defined behaviour and meaning
Known identity / location
Smallest unit of transaction
“of interest” to healthcare
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
What is/isn’t a Resource?
Examples Non-examples
Administrative Gender
Patient, Location, Too small
Encounter, Organization, Blood Pressure
Clinical Concepts Too specific
AllergyIntolerance, Pregnancy
Questionnaire, Observation
Too broad
Infrastructure
Electronic Health Record
Document, Message,
Profile, Conformance Too big
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Structure of a Resource
Metadata
Narrative
Resource
Elements
Extensions Extensions
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Structure of a Resource
(XML example)
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Human Readable
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Resources in the spec
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Composition vs. reference
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Composition of a Resource
Resource Root
Resource Component
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Composition
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Diagnostic
Patient
Report
Practitioner
Observation
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Resource Reference
Example: part of DiagnosticReport
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
http://fhirblog.com/2014/01/24/modelling-
encounters-with-fhir/
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Not a hierarchy!
Patient
Episode Episode
Visit Visit
Observation Order
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
A Resource’s identity
In fact: an URL
resource type
http://server.org/fhir/Patient/1
endpoint identifier
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
“Business” identifiers
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Resource metadata
Metadata
http://hl7.org/fhir/tag
http://example.org/fhir/Status#Test
http://hl7.org/fhir/tag/profile
http://hl7.org/fhir/Profile/us-core
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
How FHIR uses RESTful principles to communicate Resources
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
REST?
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Possibly distributed…
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
“Repository” model of
healthcare
Hospital System Lab System
FHIR server
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Just a quick GET
HTTP/1.1 200 OK
Content-Type: application/xml+fhir;charset=utf-8
Content-Length: 787
Content-Location:
http://spark.furore.com/fhir/Patient/1/_history/12
Last-Modified: Tue, 29 May 2012 23:45:32 GMT
UTF-8
encoded
<?xml version="1.0" encoding="UTF-8"?>
<Patient xmlns="http://hl7.org/fhir"><identifier><label>SSN</label><identifier><system>
http://hl7.org/fhir/sid/usssn</system><id>444222222</id></identifier></identifier><name><use>official
</use><family>Everywoman</family><given>Eve</given></name><telecom><system>phone</system><value>555-
555 2003</value><use>work</use></telecom><gender><system>http://hl7.org/fhir/sid/v2-0001</system>
<code>F</code></gender><birthDate>1973-05-31</birthDate><address><use>home</use><line>2222 Home
Street</line></address><text><status>generated</status><div
xmlns="http://www.w3.org/1999/xhtml">Everywoman, Eve. SSN:444222222</div></text></Patient>
See the BOM?
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
A Resource’s REST identity
In fact: an URL
resource type
http://server.org/fhir/Patient/1
endpoint identifier
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Remember metadata?
Metadata
http://hl7.org/fhir/tag
http://example.org/fhir/Status#Test
http://hl7.org/fhir/tag/profile
http://hl7.org/fhir/Profile/us-core
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Tag metadata
HTTP/1.1 200 OK
Content-Location: http://server.com/fhir/Patient/1/_history/12
Last-Modified: Tue, 29 May 2012 23:45:32 GMT
Category: http://example.org/fhir/Status#Test;
scheme="http://hl7.org/fhir/tag"; label="Our test tag"
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Mapping (meta)data to
HTTP
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
REST “representations”
HTTP/1.1 200 OK
Content-Type: application/json+fhir;charset=utf-8
Content-Length: 787
HTTP/1.1 200 OK
Content-Type: application/json+fhir;charset=utf-8
Content-Length: 787
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Updating, creating & deleting single resources using REST
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
One more look at the
header
GET /fhir/Patient/1 HTTP/1.1
HTTP/1.1 200 OK
Content-Type: application/xml+fhir;charset=utf-8
Content-Length: 787
Content-Location:
http://spark.furore.com/fhir/Patient/1/_history/12
Last-Modified: Tue, 29 May 2012 23:45:32 GMT
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
For a specific version…
endpoint
http://server.org/fhir/ (continued)
resource type
Patient/1/_history/4
identifier version id
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Question
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
REST in the spec
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Mapping to verbs
create 2.1.10
The create interaction creates a new resource in a server assigned location. The create
interaction is performed by an HTTP POST operation as shown:
POST [service-url]/[resourcetype] (?_format=mimeType)
read 2.1.6
The read interaction accesses the current contents of a resource. The interaction is
performed by an HTTP GET operation as shown:
GET [service-url]/[resourcetype]/{id} (?_format=mimeType)
update 2.1.8
The update interaction creates a new current version for an existing resource or creates a
new resource if no resource already exists for the given id. The update interaction is
performed by an HTTP PUT operation as shown:
PUT [service-url]/[resourcetype]/{id} (?_format=mimeType)
delete 2.1.9
The delete interaction removes an existing resource. The interaction is performed by an
HTTP DELETE operation as shown:
DELETE [service-url]/[resourcetype]/{id}
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Exercise #1
(20 minutes)
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Exercise #1
Install Fiddler2
Try getting a single patient:
• GET a patient with id ‘example’ (on spark.furore.com/fhir)
• Look at the response headers and validate that they are correct.
• Look at the xml and try to find an extension
• Find a resource reference and fetch the referenced Resource
• Try to get the same patient in JSON
‒ Using the _format parameter
‒ Using an Accept header
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
The basic building blocks of FHIR
DECONSTRUCTING THE
FHIR DATAMODEL
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
The FHIR Elements
Composite Constrained
Metadata Types
Datatypes
(HumanName, (Quantity:
Quantity, Period, Distance, Count,
Address, Identifier )
Narrative Duration, Money)
use
Resource
Elements use
Extensions Extensions
use
Primitives Derived
(integer, boolean,
string, instant) Primitives
(oid, uuid,
code, id)
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Start at the bottom:
Primitives
boolean xs:boolean Values can be either true or false
integer xs:int A signed 32-bit integer
A rational number. A true decimal, with
decimal xs:decimal
inbuilt precision (e.g. Java BigDecimal)
base64Binary xs:base64Binary A stream of bytes, base64 encoded
An instant in time - known at least to the
instant xs:dateTime second and always includes a
timezone.
string xs:string A sequence of Unicode characters.
uri xs:anyURI A Uniform Resource Identifier Reference.
union of xs:date,
A date, or partial date as used in
date xs:gYearMonth,
human communication. No time zone.
xs:gYear
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Derived primitives
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Level up:
Composite Datatypes
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Datatypes
http://www.hl7.org/implement/standards/fhir/datatypes.html
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Coded types
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Coded types
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
• Publication meta-
data
• Concepts from 1 or
more existing
systems
• Additional concepts
62
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Level up: resources
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
“Choice” properties
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
References
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Quick look at extensions
Metadata
Narrative
Resource
Elements
Extensions Extensions
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Extensions
Patient
MRN 22234
+ Haircolor BROWN
“Ewout Kramer”
30-11-1972 You can extend:
Amsterdam - Resources
- Elements of Resources
- FHIR Datatypes
Organization
“ACME Hospital”
National Drive 322
Orlando, FL
+ Taxoffice Id NLOB33233
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Extending a multiple birth
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Complex extensions
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Quick look at narrative
Metadata
Narrative
Resource
Elements
Extensions Extensions
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Narrative
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Exercise #2
(45 minutes)
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Exercise #2
Store the patient from last exercise somewhere on
your machine.
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
How FHIR uses Atom to communicate sets of resources
BUNDLES
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Communicating lists
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Bundle
Resource
Metadata
Metadata
Bundle Resource
Narrative
Resource
Elements
Extensions Resource
Extensions
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Bundles
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
An example Bundle
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Resource metadata
Metadata
http://hl7.org/fhir/tag
http://example.org/fhir/Status#Test
http://hl7.org/fhir/tag/profile
http://hl7.org/fhir/Profile/us-core
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Resource Entry
Resource id
Last modified
Tags
Version specific id
Resource content
Human-readable form,
just like Resource.text
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
SEARCH FUNCTIONALITY
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Getting “all” patients
http://server.org/fhir/Patient
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Search (patient)
Each resource has a set of “standard”
search operations, so not every element
can be searched!:
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Demo
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
WHAT’S NEXT?
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
Next Steps for you
fhir@lists.hl7.org
#FHIR
Implementor’s Skype Channel
StackOverflow: hl7 fhir tag
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
International Working Group Meeting
Mark Your Calendar and Join Us!
Paris, France
May 10 – 15
88
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
International HL7 FHIR Developer Days
November 18-20, 2015 in Amsterdam
Education
Tutorials
Connectathon
Meet fellow developers
Put FHIR to the test
Networking
FHIR experts and authors on hand
http://fhir.furore.com/devdays
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
The End –
Questions?
© 2012 HL7 ® International. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.