2. • HL7, (Health Level Seven), is a standard for exchanging
information between medical applications
• This standard defines a format for the transmission of
health-related information
• Examples of HL7 messages include patient records,
laboratory records and billing information
WHAT IS HL7?
3. • V2 - HL7's first information exchange standard and is one of its most widely adopted
• V3 - It was intended to be the next generation of HL7's messaging standards. It introduced a common Reference
Information Model (RIM), data type model and set of vocabulary as well as a formal standards development methodology.
• Clinical Document Architecture (CDA) - It is HL7's most widely adopted HL7 v3 standard. It provides both a
standardized header containing metadata about the document as well as the ability to convey a wide variety of clinical
content organized into various sections.
• FHIR - combines the best features of HL7 V2, HL7 V3, and CDA. It provides atomic access to medical data via a RESTful
API (using XML & JSON). It's the latest protocol and is quickly becoming more popular standard.
HL7 STANDARDS
4. • FHIR stands for Fast Healthcare Interoperability
Resource.
• FHIR combines the best features of HL7 V2, HL7 V3, and
CDA, while leveraging the latest web service technologies.
• FHIR is based on Resource-Oriented RESTful API’s. This
is in contrast to the majority of IHE profiles which are
based on SOAP web services.
• CRUD + Search
• Can be extended
WHAT IS FHIR?
5. FHIR STANDARDS
● DSTU1 (First draft standard for trial use)
● DSTU2 (Second draft standard for trial use)
● Release3 (STU - standard for trial use)
● Release4 (1st normative contents + trial
use developments)
● Release5(will be out 3rd quarter of 2020)
6. WHY FHIR - R4?
● V3 is too hard
● Documents(CDA) are not enough
● V2 needs a transition path
● There are new markets and HL7 needs
something to offer
● The world has evolved
7. FHIR R5: UPCOMING RELEASE. WHAT’S NEW?
● FHIR R5 will include standards that
provide access to a complete patient
record, specifications related to
genomic reporting and improved
integration with financial processes
● HL7 plans to move more content to
"normative" status, which it rolled out in
FHIR release 4. A normative standard
means future updates will be "backward
compatible," according to the nonprofit.
8. FHIR R5: WHEN TO EXPECT?
● HL7 plans to debut FHIR release 5 in
the third quarter of 2020
10. ● Small, light-weight and loosely coupled.
● Instead of system specific API, we could utilise
standards defined in the HTTP specification (i.e. GET,
POST, etc) and standardise how we return the payload
RESTFUL API
SERVICES
● Custom support to address specific requirements
that aren’t fully supported by other paradigms
11. DOCUMENTS
MESSAGING
● Multiple resources in a single exchange
● Request message is sent from a source application to a
destination application when an event happens
● Multiple resources bundled to support data persistence
and maximum compatibility.
● Send documents to remote systems while avoiding
direct coupling to remote procedures.
● A FHIR Document may be sent as the payload of a
RESTful Response, Message etc.,
12. WHERE CAN I FIND LATEST
STABLE MODEL (FHIR R4)
HOW DO I FIND THE LATEST RESOURCES (CLASSES)?
http://hl7.org/fhir/
Click here
20. Each resource contains an element "meta", of type "Meta", which is a set of metadata that provides technical and workflow
context to the resource. The metadata items are all optional, though some or all of them may be required in particular
implementations or contexts of use.
RESOURCE METADATA
28. ● HAPI started in 2001 as an HL7 v2 Library
● HAPI FHIR is a complete implementation of the HL7 FHIR
standard for healthcare interoperability in Java
● It is an Open Community Developing Software licensed
under the business-friendly Apache Software 2.0
● HAPI defines model classes for every resource type and
datatype defined by the FHIR specification
● Current version of HAPI FHIR is 4.2.0 (Koala)
WHAT IS HAPI FHIR?
29. Various versions of HAPI FHIR Library and corresponding versions of FHIR Standard that they support
FHIR AND HAPI FHIR VERSIONS
* Green = Stable release / Yellow = Pre-release
30. HAPI: THE KEY COMPONENTS
● Working With Resources
● Parsing and Serializing
● Resource References
● Profiles and Extensions
● Version Converters
● Custom Structures
● Narrative Generation
31. WORKING WITH RESOURCES
● Every resource type defined by FHIR has a corresponding class, which contains a number of getters
and setters for the basic properties of that resource
● HAPI tries to make populating objects easier, by providing lots of convenient methods
● FHIR specification defines a "closed" ValueSets/"coded" string must either be empty, or be
populated with a value drawn from the list of allowable values defined by FHIR. HAPI provides
special typesafe Enums to help in dealing with these fields. Eg. Patients.gender
● FHIR data model is rich enough to meet most common use cases
32. WORKING WITH RESOURCES - CONT'D
Example below shows populating a name entry for a Patient entity and use of the StringDt type, which encapsulates a
regular String, but allows for extensions to be added
HAPI also provides for simple setters that use Java primitive types and can be chained, leading to much simpler code
33. PARSING AND SERIALIZING
● HAPI FHIR has built-in support for the FHIR JSON and XML encoding formats
● A built in parser can be used to convert HAPI FHIR Java objects into a serialized form, and to
parse serialized data into Java objects
● HAPI FHIR does not have separate parsers and serializers. Both of these functions are
handled by a single object called the Parser
● Parsing begins with a FhirContext object and can be used to request an IParser for your
chosen encoding style (Serializing/Deserializing) that is then used to parse
34. RESOURCE REFERENCES
Eg. Consider the Patient resource
Call to
String reference =
patient.getManagingOrganization().getReference();
returns a String containing Organization/123
● Resource references are a key part of the HAPI FHIR
model
● Reference type is the datatype for references and has
number of properties which help make working with
FHIR simple
● The getReference() method returns a String that
contains the identity of the resource being referenced
● Reference also has a place for storing actual resource
instances (i.e. an actual IBaseResource instance)
● References in Client Code: resource which was
received as a part of the same response either a
Contained resource or Separate resource in a bundle
● References in Server Code: return a resource which
contains a link to another resource
35. PROFILES AND EXTENSIONS
● Extensions are a key part of the FHIR specification, providing a standardized way of placing additional data in a
resource
● Extensions may also have child extensions as their content, instead of a datatype
● Consider the example below with DSTU3 Standard of FHIR
36. VERSION CONVERTERS
● Allows automated conversion from earlier versions of the FHIR structures to a later version
● Import hapi-fhir-converter module
● Example shows a conversion from a hapi-fhir-structures-hl7org-dstu2 structure to a hapi-fhir-structures-dstu3
structure
37. CUSTOM STRUCTURES
● HAPI allows to create an entirely custom resource type
● Use only if no other options, meaning create a resource type that will not be interoperable with other FHIR
implementations
NARRATIVE GENERATION
● HAPI provides several ways to add Narrative Text to your encoded messages
● The simplest way is to simply place the narrative text directly in the resource via the setDivAsString() method
● Types:
○ Automatic Narrative Generation
○ Built-in Narrative Templates
○ Creating your own Templates
● Example below
38. HAPI FHIR - OTHER BUILT-IN MECHANISMS
● Offers REST Server/clients
● JPA Server
● Interceptors
● Security
● Validators
● Android Client
● Command Line Interface (CLI) Tools
39. HAPI FHIR CLIENT
● HAPI FHIR provides a built-in mechanism for connecting to FHIR REST servers.
● There are two types of REST clients provided by HAPI:
○ Generic (Fluent) client
○ Annotation Client
● A quick start demo app is available at hapi-fhirstarters-client-skeleton
40. GENERIC (FLUENT) CLIENT
● Creating a generic client simply requires you to create an instance of FhirContext and use that to instantiate a client.
● The following example shows how to create a client, and a few operations which can be performed.
● The fluent interface allows you to construct powerful queries by chaining method calls together, leading to highly readable code. It also
allows you to take advantage of intellisense/code completion in your favourite IDE.
● Note that most fluent operations end with an execute() statement which actually performs the invocation. You may also invoke several
configuration operations just prior to the execute() statement such as encodedJson() or encodedXml().
41. VARIOUS WAYS OF SEARCH THROUGH CLIENT
Searching is a very powerful part of the FHIR API specification itself, and HAPI FHIR aims to provide a complete
implementation of the FHIR API search specification via the generic client API.
- By Type
- Multi-valued Parameters (ANY/OR)
- Multi-valued Parameters (ALL/AND)
- Paging
- Composite Parameters
- By plain URL
- Other Query Options
- Using HTTP POST
- Compartments
- Subsetting (_summary and _elements)
42. SIMPLE SEARCH CLIENT EXAMPLE
The following examples shows how to query using the generic client:
Search with multi-valued parameters
43. CREATE USING GENERIC CONTENT
The following example shows how to perform a create operation using the generic client:
44. WAYS WE CAN USE HAPI FHIR
Use the HAPI FHIR parser and encoder to convert between FHIR and your application's data model.
Use the HAPI FHIR client in an application to fetch from or store resources to an external server
Your
Application
Hapi
Model
Objects
HAPI FHIR
Parser
(XMI/Json)
Raw FHIR
Resources
HAPI FHIR
Parser
(XMI/Json)
Hapi
Model
Objects
Your
Application
Hapi
Model
Objects
HAPI FHIR
Parser
(XMI/Json)
External FHIR Server
HTTP
45. WAYS WE CAN USE HAPI FHIR
Use the HAPI FHIR server in an application to allow external applications to access or modify your application's data
Use the HAPI JPA/Database Server to deploy a fully functional FHIR server you can develop
applications against.
Your
Application
Hapi
FHIR
Server
Hapi
Model
Objects
External FHIR Server
HTTP
HAPIJPA
Database
Server
Hapi
FHIR
Server
JPI
Persistence
Module
Your FHIR Server
HTTP