SlideShare a Scribd company logo
FHIR® is the registered trademark of HL7 and is used with the permission of HL7. The Flame Design mark is the registered trademark of HL7 and is used with the permission of HL7.
Amsterdam, 15-17 November | @fhir_furore | #fhirdevdays17 | www.fhirdevdays.com
Building Bridges: Mapping HL7 V2 to FHIR
Simone Heckmann, Gefyra GmbH / HL7 Germany
Who we are
„gefyra“ is the Greek word for „bridge“
We offer
• FHIR training,
• consultancy for FHIR projects
• professional tooling
• integration services (j/w Health-Comm,
based on INfOR Cloverleaf®)
We have been involved with FHIR since
2014,
have tested our V2 mappings on > 7
Connectathons,
and have them running in production
environments
V2-based EHR
Integration Engine
FHIR-Server
FHIR-Clients
ADT-Messages
?
FHIR als Daten-Hub
6
Integration Engine
Scenario
• Mapping a V2 ADT_A01 message
http://wiki.hl7.org/index.php?title=Version_2_
-_FHIR_Mapping_Scenarios
MSH|^~&|LegacyEHR||SPARK||20150502090000||ADT^A01|00000002|P|2.5
EVN|A01|20150502090000|
PID|1||345345412312345^10^^NHS^NH~456756756745^^^TCPAS^MR||Gefyra^Alpha^F^^Ms^
^L||19280524|F|||Bridge Street 22^^Bridgetown^^^12345^^^^P||277543^PRN|||U||
NK1|1|Gefyra^Beta|FTH|||+44 201 12345678||
PV1||I|INT^0001^02^GENHOS||||0100^ANDERSON,CARL|0148^ADDISON,JAMES||SUR|||||||
0148^ANDERSON,CARL|S|234637^^^GENHOS|A|||||||||||||||||||GENHOS|||||2015050209
0000|
AL1|1|DA|1605^acetaminophen^L|MO|Muscle Pain~hair loss
AL1|2|DA|1558^Oxycodone^L|MO|Muscle Pain~hair loss
AL1|3|MA|2221^Peanuts^L|SV|Anaphylactic Shock
MSH|^~&|LegacyEHR||SPARK||20150502090000||ADT^A01|00000002|P|2.5
EVN|A01|20150502090000|
PID|1||345345412312345^10^^NHS^NH~456756756745^^^TCPAS^MR||Gefyra^Alpha^F^^Ms^
^L||19280524|F|||Bridge Street 22^^Bridgetown^^^12345^^^^P||277543^PRN|||U||
NK1|1|Gefyra^Beta|FTH|||+44 201 12345678||
PV1||I|INT^0001^02^GENHOS||||0100^ANDERSON,CARL|0148^ADDISON,JAMES||SUR|||||||
0148^ANDERSON,CARL|S|234637^^^GENHOS|A|||||||||||||||||||GENHOS|||||2015050209
0000|
AL1|1|DA|1605^acetaminophen^L|MO|Muscle Pain~hair loss
AL1|2|DA|1558^Oxycodone^L|MO|Muscle Pain~hair loss
AL1|3|MA|2221^Peanuts^L|SV|Anaphylactic Shock
Patient
Encounter
AllergyIntolerance(s)
MessageHeader
…so, it‘s a Bundle of Resources!
• Yes. But there are multiple types
of Bundles.
Is it a message, a batch, a
transaction or a document…?
http://build.fhir.org/bundle.html
Building bridges devdays 2017- powerpoint template
A message, obviously!
• True, but which event? Which
structure? What‘s the logic
associated with the event? Does
the server know all this?
• Do we really want to re-implement
V2 messaging with FHIR?
http://build.fhir.org/messagedefinition.html
So what do we do?
• We (the integration engine) know
what the events mean and which
actions we expect the server to
perform. So we can tell the server
what to do.
• Let‘s try Transactions!
how
what
MSH|^~&|LegacyEHR||SPARK||20150502090000||ADT^A01|00000002|P|2.5
EVN|A01|20150502090000|
PID|1||345345412312345^10^^NHS^NH~456756756745^^^TCPAS^MR||Gefyra^Alpha^F^^Ms^
^L||19280524|F|||Bridge Street 22^^Bridgetown^^^12345^^^^P||277543^PRN|||U||
NK1|1|Gefyra^Beta|FTH|||+44 201 12345678||
PV1||I|INT^0001^02^GENHOS||||0100^ANDERSON,CARL|0148^ADDISON,JAMES||SUR|||||||
0148^ANDERSON,CARL|S|234637^^^GENHOS|A|||||||||||||||||||GENHOS|||||2015050209
0000|
AL1|1|DA|1605^acetaminophen^L|MO|Muscle Pain~hair loss
AL1|2|DA|1558^Oxycodone^L|MO|Muscle Pain~hair loss
AL1|3|MA|2221^Peanuts^L|SV|Anaphylactic Shock
Patient -> create/update?
Encounter -> create
AllergyIntolerance(s) -> purge/create
Now, let‘s REST-ify that!
How do I update/create?
• We need to check if the Patient
already exists. If it does, we want
to PUT, if it doesn‘t we want to
POST.
• Enter the „Conditional UPDATE“!
http://build.fhir.org/http.html#2.42.0.10.2
Building bridges devdays 2017- powerpoint template
So what‘s the criteria?
• The Conditional UPDATE will fail if
it matches multiple resources, so
our criteria must identify the
Patient uniquely.
• Sounds like „identifier“, right?
http://build.fhir.org/search.html#token
PID|1||345345412312345^10^^NHS^NH~456756756745^^^TCPAS^MR||
urn:oid:2.16.840.1.113883.2.1.4.1 http://www.ghh.org/identifiers
How do I purge/create?
• First, we need to DELETE all
previously submitted
AllergyIntolerances, then POST the
new ones. But wait! We need to
make sure, we only delete the
ones we (the integration engine)
created!
• Enter the „Conditional Delete“!
http://build.fhir.org/http.html#2.42.0.12.1
So what‘s the criteria?
• Somehow we need to be able to
recognize the AllergyIntolerances
we submitted.
This can be achieved by either
• adding tags to the resource
metadata (simple) or
• using Provenance resources (not
so simple, but more powerful)
http://build.fhir.org/resource.html#Meta
http://build.fhir.org/provenance.html
So, if we use tags, our criteria is:
DELETE [base]/AllergyIntolerance?patient.identifier=[?]&_tag=[?]
„chained search“ „token parameter“
These are our resources!
That‘s us!
So, in our case:
GET [base]/AllergyIntolerance?patient.identifier=[?]&_has:Provenance:agent:device=[?]
We also need to create a Device resource!
Advantage: the Provenance Resource also gives us an chance to store the original message for traceability as an
Attachment. (…yes, we need to create that resource, too…)
Does that really work?
• Well, we made it work (at least,
with tags)
after changing the processing
order for Transactions to
DELETE > POST > PUT > GET
http://build.fhir.org/http.html#2.42.0.16.2
Now: the field mapping!
• Check the „mapping“ tab at the
top of each resource
• There‘s no „one-size-fits-all“ – V2
structures and FHIR server
requirements will vary!
• + look at the FHIR mapping
language and StructureMap
resource!
• + look at ConceptMap resource
and the $translate-Operation!
http://build.fhir.org/mapping-language.html
http://build.fhir.org/structuremap.html
http://build.fhir.org/conceptmap.html
http://build.fhir.org/terminology-service.html#4.6.8
How do I reference a resource that doesn‘t have a url
(yet)?
• Assign a UUID to every
Bundle.entry.fullUrl
Then reference the associated
resource by this uri.
The server must replace UUIDs
with the actual urls when
processing the Transaction
http://build.fhir.org/bundle.html#references
Building bridges devdays 2017- powerpoint template
But what if I don‘t want to touch the resource I need to
reference?
• Conditional Update will update the
matching resource,
Conditional Create will create a
new resource if none matches.
Both can get us into trouble, if we
don‘t have permission to
create/update specific resources.
• Solution: Use Conditional
References instead!
http://build.fhir.org/bundle.html#references
Building bridges devdays 2017- powerpoint template
Limitations!
• V2 Source will overwrite all changes and additions to Resources on
the Server (-> Patch)
• There is no „trigger“ to invoke additional actions on the server (->
Message/Operations)
• „Merge“ is tricky (-> Operations)
• Doesn‘t work in the absence of REST Protocol (-> Message)
• Is it PV1 actually an Encounter or rather an EpisodeOfCare?
The MERGE hack
• Create two Patient resource from the A40‘s PID, one with the good, one
with the bad identifier.
• Create the conditional update URLs accordingly
• Add a link (type=„replaces“) from the good to the bad Patient
• Add a link (type=„replaced-by“) from the bad to the good Patient
• Set the bad Patient to „inactive“
• Downside: we‘re losing the NK1 information when updating the good
patient! -> try to PATCH the link into the good Patient instead
What if the server doesn‘t support Transactions?
• Basically, the Transaction Bundle constitutes a list of
individual, atomic REST interactions. We can run them
through „post processing“ and split them up.
• But remember: we have to handle the replacing of the
UUIDs with the actual URLs ourselves!
• We can even split the Conditional interactions up into a
GET and PUT/POST/DELETE interaction,
But then we have to deal with the errors on our side.
You can move complexity around,
but you can‘t make it go away
(Grahame Grieve)
Client Server
Message
Transaction
Plain REST
Complexity
Complexity
Client Server
V2-based EHR
Integration Engine
FHIR-Server
FHIR-Clients
ADT-Messages
Transaction-Bundles
V2-based EHR
Integration Engine
FHIR-Server
FHIR-Clients
ORU-Messages
/Observation/_history
Searchset Bundle
?
_history Subscription
+ reliability
+ simple to implement
+ repeatable (if something went
wrong)
- not selective/high traffic
- delay
- second interaction for includes
+ realtime
+ selective
+ low bandwidth
- no queueing
- no trigger if a resource drops out
of your selection
What next?
• Tell us about your use case and join the Hands On
• Give feedback at https://chat.fhir.org/#narrow/stream/v2.20to.20FHIR
• Join the discussion on how to handle merge
• Join the next connectathon in San Antonio and help us to
evaluate Subscription and _history interactions to transfer
Resources from a FHIR server back to a V2 system
http://wiki.hl7.org/index.php?title=201701_Resource_Subscription_Track
we make fhir® work

More Related Content

PPTX
fhir-documents
PPTX
Devdays 2017 implementation guide authoring - ardon toonstra
PPTX
Whats new (grahame)
PPTX
Furore devdays2017 tdd-2-advanced
PPTX
Security overview (grahame)
PPTX
Furore devdays2017 tdd-1-intro
PPTX
Furore devdays 2017 - workflow
PPTX
Furore devdays2017 general-introtofhir
fhir-documents
Devdays 2017 implementation guide authoring - ardon toonstra
Whats new (grahame)
Furore devdays2017 tdd-2-advanced
Security overview (grahame)
Furore devdays2017 tdd-1-intro
Furore devdays 2017 - workflow
Furore devdays2017 general-introtofhir

What's hot (20)

PPTX
Validation in net and java (ewout james)
PPTX
Fhir dev days 2017 fhir profiling - overview and introduction v07
PPTX
Advanced .net api (ewout)
PPTX
Fhir foundation (grahame)
PPTX
20171116 rene spronk_profiling_governance
PPTX
2017 11-ccda-on-fhir
PDF
Integrating with the epic platform fhir dev days 17
PPTX
Furore devdays 2017- rdf2(solbrig)
PPTX
Furore devdays 2017-sdc (lloyd)
PPTX
Furore devdays 2017- continua implementing fhir
PPTX
final Keynote (grahame)
PPTX
Fhir dev days_basic_fhir_terminology_services
PPTX
Profiling with clin fhir
PPTX
Furore devdays 2017- profiling academy - profiling guidelines v1
PPTX
Fhir tooling (grahame)
PPTX
Dev days 2017 questionnaires (brian postlethwaite)
PDF
Building on cerner with smart on fhir fhir dev days 2017
PPTX
Beginners .net api dev days2017
PPTX
IHE on FHIR and DICOMweb 2017
PPTX
Building a Scenario using clinFHIR
Validation in net and java (ewout james)
Fhir dev days 2017 fhir profiling - overview and introduction v07
Advanced .net api (ewout)
Fhir foundation (grahame)
20171116 rene spronk_profiling_governance
2017 11-ccda-on-fhir
Integrating with the epic platform fhir dev days 17
Furore devdays 2017- rdf2(solbrig)
Furore devdays 2017-sdc (lloyd)
Furore devdays 2017- continua implementing fhir
final Keynote (grahame)
Fhir dev days_basic_fhir_terminology_services
Profiling with clin fhir
Furore devdays 2017- profiling academy - profiling guidelines v1
Fhir tooling (grahame)
Dev days 2017 questionnaires (brian postlethwaite)
Building on cerner with smart on fhir fhir dev days 2017
Beginners .net api dev days2017
IHE on FHIR and DICOMweb 2017
Building a Scenario using clinFHIR
Ad

Similar to Building bridges devdays 2017- powerpoint template (20)

PDF
Introduction to HL7 FHIR
PPTX
Combining Healthcare Standards with Other RESTful APIs
PDF
Slides from Perth MuleSoft Meetup March 2025
PPTX
HL7 Survival Guide - Chapter 10 – Process and Workflow
PDF
Automation for the Humans
PPTX
Lessons learned on the Azure API Stewardship Journey.pptx
PPTX
How to get along with HATEOAS without letting the bad guys steal your lunch -...
PPTX
Flexible EDI Solutions for the SMB Market
PDF
DevOps Deconstructed
PDF
UKOUG Tech15 - Use Case with Oracle SOA Integration for Healthcare – 12c
PPT
Iehr ciif sdk-slides-draft-h
TXT
services order
PDF
WSO2 ESB Integration with REST
PPTX
Making Sense of Hypermedia APIs – Hype or Reality?
PDF
Taming Big Data with Big SQL 3.0
PPT
Wellness Through Workflow: How Workflow Contributes to a Better Patient Exper...
PPTX
API Design Tour: Digital River
PDF
EVOLVE`13 Keynote: Scrambled Eggs
PDF
EVOLVE'13 | Keynote | Roy Fielding
PDF
WSO2Con Asia 2014 - Reinventing Enterprise Integration for Connected Business
Introduction to HL7 FHIR
Combining Healthcare Standards with Other RESTful APIs
Slides from Perth MuleSoft Meetup March 2025
HL7 Survival Guide - Chapter 10 – Process and Workflow
Automation for the Humans
Lessons learned on the Azure API Stewardship Journey.pptx
How to get along with HATEOAS without letting the bad guys steal your lunch -...
Flexible EDI Solutions for the SMB Market
DevOps Deconstructed
UKOUG Tech15 - Use Case with Oracle SOA Integration for Healthcare – 12c
Iehr ciif sdk-slides-draft-h
services order
WSO2 ESB Integration with REST
Making Sense of Hypermedia APIs – Hype or Reality?
Taming Big Data with Big SQL 3.0
Wellness Through Workflow: How Workflow Contributes to a Better Patient Exper...
API Design Tour: Digital River
EVOLVE`13 Keynote: Scrambled Eggs
EVOLVE'13 | Keynote | Roy Fielding
WSO2Con Asia 2014 - Reinventing Enterprise Integration for Connected Business
Ad

More from DevDays (16)

PPTX
Consent dev days
PPTX
Mohannad hussain dicom and imaging tools
PPTX
Mohannad hussain community track - siim dataset & dico mweb proxy
PPTX
Transforming other content (grahame)
PPTX
Structure definition 101 (ewout)
PPTX
Quality improvement dev days-2017
PPTX
Furore devdays 2017- rdf1(solbrig)
PPTX
Furore devdays 2017- oai
PPTX
Furore devdays 2017 - implementation guides (lloyd)
PPTX
Dev days 2017 advanced directories (brian postlethwaite)
PPTX
Connectathon opening 2017
PPTX
20171127 rene spronk_messaging_the_unloved_paradigm
PPTX
Vonk fhir facade (christiaan)
PPTX
Opening student track
PPTX
Fhir dev days_advanced_fhir_terminology_services
PPTX
Distributing cds dev days-2017
Consent dev days
Mohannad hussain dicom and imaging tools
Mohannad hussain community track - siim dataset & dico mweb proxy
Transforming other content (grahame)
Structure definition 101 (ewout)
Quality improvement dev days-2017
Furore devdays 2017- rdf1(solbrig)
Furore devdays 2017- oai
Furore devdays 2017 - implementation guides (lloyd)
Dev days 2017 advanced directories (brian postlethwaite)
Connectathon opening 2017
20171127 rene spronk_messaging_the_unloved_paradigm
Vonk fhir facade (christiaan)
Opening student track
Fhir dev days_advanced_fhir_terminology_services
Distributing cds dev days-2017

Recently uploaded (20)

PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Computing-Curriculum for Schools in Ghana
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PDF
Weekly quiz Compilation Jan -July 25.pdf
PPTX
Cell Types and Its function , kingdom of life
PDF
Trump Administration's workforce development strategy
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
Complications of Minimal Access Surgery at WLH
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
PPTX
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
PDF
01-Introduction-to-Information-Management.pdf
PPTX
Lesson notes of climatology university.
PDF
A systematic review of self-coping strategies used by university students to ...
PPTX
master seminar digital applications in india
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
human mycosis Human fungal infections are called human mycosis..pptx
Anesthesia in Laparoscopic Surgery in India
Final Presentation General Medicine 03-08-2024.pptx
Computing-Curriculum for Schools in Ghana
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
Weekly quiz Compilation Jan -July 25.pdf
Cell Types and Its function , kingdom of life
Trump Administration's workforce development strategy
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
Microbial diseases, their pathogenesis and prophylaxis
Complications of Minimal Access Surgery at WLH
2.FourierTransform-ShortQuestionswithAnswers.pdf
1st Inaugural Professorial Lecture held on 19th February 2020 (Governance and...
school management -TNTEU- B.Ed., Semester II Unit 1.pptx
01-Introduction-to-Information-Management.pdf
Lesson notes of climatology university.
A systematic review of self-coping strategies used by university students to ...
master seminar digital applications in india
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
202450812 BayCHI UCSC-SV 20250812 v17.pptx

Building bridges devdays 2017- powerpoint template

  • 1. FHIR® is the registered trademark of HL7 and is used with the permission of HL7. The Flame Design mark is the registered trademark of HL7 and is used with the permission of HL7. Amsterdam, 15-17 November | @fhir_furore | #fhirdevdays17 | www.fhirdevdays.com Building Bridges: Mapping HL7 V2 to FHIR Simone Heckmann, Gefyra GmbH / HL7 Germany
  • 2. Who we are „gefyra“ is the Greek word for „bridge“ We offer • FHIR training, • consultancy for FHIR projects • professional tooling • integration services (j/w Health-Comm, based on INfOR Cloverleaf®) We have been involved with FHIR since 2014, have tested our V2 mappings on > 7 Connectathons, and have them running in production environments
  • 5. Scenario • Mapping a V2 ADT_A01 message http://wiki.hl7.org/index.php?title=Version_2_ -_FHIR_Mapping_Scenarios
  • 6. MSH|^~&|LegacyEHR||SPARK||20150502090000||ADT^A01|00000002|P|2.5 EVN|A01|20150502090000| PID|1||345345412312345^10^^NHS^NH~456756756745^^^TCPAS^MR||Gefyra^Alpha^F^^Ms^ ^L||19280524|F|||Bridge Street 22^^Bridgetown^^^12345^^^^P||277543^PRN|||U|| NK1|1|Gefyra^Beta|FTH|||+44 201 12345678|| PV1||I|INT^0001^02^GENHOS||||0100^ANDERSON,CARL|0148^ADDISON,JAMES||SUR||||||| 0148^ANDERSON,CARL|S|234637^^^GENHOS|A|||||||||||||||||||GENHOS|||||2015050209 0000| AL1|1|DA|1605^acetaminophen^L|MO|Muscle Pain~hair loss AL1|2|DA|1558^Oxycodone^L|MO|Muscle Pain~hair loss AL1|3|MA|2221^Peanuts^L|SV|Anaphylactic Shock
  • 7. MSH|^~&|LegacyEHR||SPARK||20150502090000||ADT^A01|00000002|P|2.5 EVN|A01|20150502090000| PID|1||345345412312345^10^^NHS^NH~456756756745^^^TCPAS^MR||Gefyra^Alpha^F^^Ms^ ^L||19280524|F|||Bridge Street 22^^Bridgetown^^^12345^^^^P||277543^PRN|||U|| NK1|1|Gefyra^Beta|FTH|||+44 201 12345678|| PV1||I|INT^0001^02^GENHOS||||0100^ANDERSON,CARL|0148^ADDISON,JAMES||SUR||||||| 0148^ANDERSON,CARL|S|234637^^^GENHOS|A|||||||||||||||||||GENHOS|||||2015050209 0000| AL1|1|DA|1605^acetaminophen^L|MO|Muscle Pain~hair loss AL1|2|DA|1558^Oxycodone^L|MO|Muscle Pain~hair loss AL1|3|MA|2221^Peanuts^L|SV|Anaphylactic Shock Patient Encounter AllergyIntolerance(s) MessageHeader
  • 8. …so, it‘s a Bundle of Resources! • Yes. But there are multiple types of Bundles. Is it a message, a batch, a transaction or a document…? http://build.fhir.org/bundle.html
  • 10. A message, obviously! • True, but which event? Which structure? What‘s the logic associated with the event? Does the server know all this? • Do we really want to re-implement V2 messaging with FHIR? http://build.fhir.org/messagedefinition.html
  • 11. So what do we do? • We (the integration engine) know what the events mean and which actions we expect the server to perform. So we can tell the server what to do. • Let‘s try Transactions!
  • 13. MSH|^~&|LegacyEHR||SPARK||20150502090000||ADT^A01|00000002|P|2.5 EVN|A01|20150502090000| PID|1||345345412312345^10^^NHS^NH~456756756745^^^TCPAS^MR||Gefyra^Alpha^F^^Ms^ ^L||19280524|F|||Bridge Street 22^^Bridgetown^^^12345^^^^P||277543^PRN|||U|| NK1|1|Gefyra^Beta|FTH|||+44 201 12345678|| PV1||I|INT^0001^02^GENHOS||||0100^ANDERSON,CARL|0148^ADDISON,JAMES||SUR||||||| 0148^ANDERSON,CARL|S|234637^^^GENHOS|A|||||||||||||||||||GENHOS|||||2015050209 0000| AL1|1|DA|1605^acetaminophen^L|MO|Muscle Pain~hair loss AL1|2|DA|1558^Oxycodone^L|MO|Muscle Pain~hair loss AL1|3|MA|2221^Peanuts^L|SV|Anaphylactic Shock Patient -> create/update? Encounter -> create AllergyIntolerance(s) -> purge/create
  • 15. How do I update/create? • We need to check if the Patient already exists. If it does, we want to PUT, if it doesn‘t we want to POST. • Enter the „Conditional UPDATE“! http://build.fhir.org/http.html#2.42.0.10.2
  • 17. So what‘s the criteria? • The Conditional UPDATE will fail if it matches multiple resources, so our criteria must identify the Patient uniquely. • Sounds like „identifier“, right? http://build.fhir.org/search.html#token
  • 19. How do I purge/create? • First, we need to DELETE all previously submitted AllergyIntolerances, then POST the new ones. But wait! We need to make sure, we only delete the ones we (the integration engine) created! • Enter the „Conditional Delete“! http://build.fhir.org/http.html#2.42.0.12.1
  • 20. So what‘s the criteria? • Somehow we need to be able to recognize the AllergyIntolerances we submitted. This can be achieved by either • adding tags to the resource metadata (simple) or • using Provenance resources (not so simple, but more powerful) http://build.fhir.org/resource.html#Meta http://build.fhir.org/provenance.html
  • 21. So, if we use tags, our criteria is: DELETE [base]/AllergyIntolerance?patient.identifier=[?]&_tag=[?] „chained search“ „token parameter“
  • 22. These are our resources! That‘s us!
  • 23. So, in our case: GET [base]/AllergyIntolerance?patient.identifier=[?]&_has:Provenance:agent:device=[?] We also need to create a Device resource! Advantage: the Provenance Resource also gives us an chance to store the original message for traceability as an Attachment. (…yes, we need to create that resource, too…)
  • 24. Does that really work? • Well, we made it work (at least, with tags) after changing the processing order for Transactions to DELETE > POST > PUT > GET http://build.fhir.org/http.html#2.42.0.16.2
  • 25. Now: the field mapping! • Check the „mapping“ tab at the top of each resource • There‘s no „one-size-fits-all“ – V2 structures and FHIR server requirements will vary! • + look at the FHIR mapping language and StructureMap resource! • + look at ConceptMap resource and the $translate-Operation! http://build.fhir.org/mapping-language.html http://build.fhir.org/structuremap.html http://build.fhir.org/conceptmap.html http://build.fhir.org/terminology-service.html#4.6.8
  • 26. How do I reference a resource that doesn‘t have a url (yet)? • Assign a UUID to every Bundle.entry.fullUrl Then reference the associated resource by this uri. The server must replace UUIDs with the actual urls when processing the Transaction http://build.fhir.org/bundle.html#references
  • 28. But what if I don‘t want to touch the resource I need to reference? • Conditional Update will update the matching resource, Conditional Create will create a new resource if none matches. Both can get us into trouble, if we don‘t have permission to create/update specific resources. • Solution: Use Conditional References instead! http://build.fhir.org/bundle.html#references
  • 30. Limitations! • V2 Source will overwrite all changes and additions to Resources on the Server (-> Patch) • There is no „trigger“ to invoke additional actions on the server (-> Message/Operations) • „Merge“ is tricky (-> Operations) • Doesn‘t work in the absence of REST Protocol (-> Message) • Is it PV1 actually an Encounter or rather an EpisodeOfCare?
  • 31. The MERGE hack • Create two Patient resource from the A40‘s PID, one with the good, one with the bad identifier. • Create the conditional update URLs accordingly • Add a link (type=„replaces“) from the good to the bad Patient • Add a link (type=„replaced-by“) from the bad to the good Patient • Set the bad Patient to „inactive“ • Downside: we‘re losing the NK1 information when updating the good patient! -> try to PATCH the link into the good Patient instead
  • 32. What if the server doesn‘t support Transactions? • Basically, the Transaction Bundle constitutes a list of individual, atomic REST interactions. We can run them through „post processing“ and split them up. • But remember: we have to handle the replacing of the UUIDs with the actual URLs ourselves! • We can even split the Conditional interactions up into a GET and PUT/POST/DELETE interaction, But then we have to deal with the errors on our side.
  • 33. You can move complexity around, but you can‘t make it go away (Grahame Grieve)
  • 37. _history Subscription + reliability + simple to implement + repeatable (if something went wrong) - not selective/high traffic - delay - second interaction for includes + realtime + selective + low bandwidth - no queueing - no trigger if a resource drops out of your selection
  • 38. What next? • Tell us about your use case and join the Hands On • Give feedback at https://chat.fhir.org/#narrow/stream/v2.20to.20FHIR • Join the discussion on how to handle merge • Join the next connectathon in San Antonio and help us to evaluate Subscription and _history interactions to transfer Resources from a FHIR server back to a V2 system http://wiki.hl7.org/index.php?title=201701_Resource_Subscription_Track