cda fhir-conversion-strategies
TRANSCRIPT
© 2016 HL7 ® International and Lantana Consulting Group. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
CDA <-> FHIRConversion Strategies
Rick GeimerFHIR Developer Days
November 2016
© 2016 HL7 ® International and Lantana Consulting Group. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
2
Lantana Consulting Group Our Mission:
Improve healthcare through health information technology (IT) Lead the industry through our consulting and volunteer practice
Our Services: Software & standard development & implementation Terminology, data governance, and education Strategic advice for health IT planning, design, and purchasing
Rick Geimer Developer of standards & software HL7 C-CDA on FHIR Lead HL7 Structured Documents Co-chair Co-author C-CDA and many other specifications Day job: Lantana CTO
© 2016 HL7 ® International and Lantana Consulting Group. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
3
This Presentation
Included Overview of key differences between
CDA and FHIR Analytical mappings available Strategies for converting parts of CDA to FHIR
and visa versa
Not included Line by line tutorial on CDA data conversion
© 2016 HL7 ® International and Lantana Consulting Group. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
4
CDA Templates vs.FHIR Resources and Profiles
Reference Information Model• Highly abstract• Act, Participation, Role…
Refined Information Model• Generic CDA• Observation, Procedure, etc.
Templated CDA• CCD or C-CDA or QRDA• Allergy – Intolerance Observation,
Problem Observation, etc.
Reference Information Model• Highly abstract• Act, Participation, Role…
Resource• FHIR component for msg, doc• AllergyIntolerance, Condition,
etc.
Profile• Localized resource• DAF-AllergyIntolerance, DAF-
Condition, etc.
Leve
l of a
bstra
ctio
n
© 2016 HL7 ® International and Lantana Consulting Group. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
5
Argonaut C-CDA to FHIR Mappings For analysis, not computable mappings Series of Google spreadsheets, one for each
major section of C-CDA CDA Header’s for various document types
not included Pre-FHIR DSTU2 Leveraged by the C-CDA on FHIR http://tinyurl.com/zhj2u9s
© 2016 HL7 ® International and Lantana Consulting Group. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
6
Argonaut C-CDA to FHIR Mappings
© 2016 HL7 ® International and Lantana Consulting Group. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
7
An Argonaut Mapping Spreadsheet
© 2016 HL7 ® International and Lantana Consulting Group. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
8
Other Mapping Sources CDA Mappings in
Individual Resources Click the Mappings tab on a
Resource page Scroll down and look for
CDA mappings CDA Logical Model and
StructureMaps Expresses CDA as a FHIR
Logical Model Allows StructureMap to be
used for conversion Status…Grahame?
© 2016 HL7 ® International and Lantana Consulting Group. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
9
CDA Header to Composition
© 2016 HL7 ® International and Lantana Consulting Group. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
10
CDA Header to Composition Details Seems straightforward at first… Actual mapping is spread across multiple
resources (Bundle, Composition, Patient, Practitioner, etc.)
Some data don’t map to core FHIR Unnecessary for your use case? Need realm specific extensions?
Some data doesn’t exist in CDA Composition.status Need appropriate defaults
© 2016 HL7 ® International and Lantana Consulting Group. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
11
Sections
Section mapping is fairly straightforward. Not much to do here but minor renaming
(section.code to section.type, etc.) Both CDA and FHIR documents allow
recursive sections. But section nesting is pretty rare in practice (at
least in US Realm CDA documents)
© 2016 HL7 ® International and Lantana Consulting Group. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
12
Converting CDA Narrative Content CDA markup is not XHTML However, the CDA.xsl contains the basic
mappings from CDA narrative to XHTML Decide how much styling you want to add
The FHIR rendering stylesheet currently displays only the XHTML of any given resource
You may need more formatting in your narrative than you would in CDA for good looking documents
© 2016 HL7 ® International and Lantana Consulting Group. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
13
Populating Composition.text Everything you want rendered from the CDA
Header, except the Patient Title, type, author, attester, etc.
Remember the rules for rendering FHIR documents: Patient Composition.text Composition.Section.text This is a SHOULD constraint, but the default stylesheet
applies this order
© 2016 HL7 ® International and Lantana Consulting Group. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
14
CDA vs. FHIR Context Conduction CDA
Hierarchical structure Association through
nested constructs Context conducts
through the hierarchy Set once in the header,
applies to everything that follows unless overridden
FHIR Flat structure Association through
references Context must be set
explicitly in each resource
© 2016 HL7 ® International and Lantana Consulting Group. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
15
Converting Coded Entries Templates to resources
Use mappings where available Note Argonaut mappings are pre-DSTU2 Be aware that moodCodes can impact this
(supply/@moodCode=RQO maps to MedicationRequest, not MedicationDispense)
Conform to profiles if applicable/available US Realm use DAF
Nested entryRelationships become references to discrete resources
Need to explicitly define context for each resource
© 2016 HL7 ® International and Lantana Consulting Group. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
16
Converting Datatypes
Mostly mechanical mappings @code value @codeSystem system
OID to URI mappings 2.16.840.1.113883.6.1 to
urn:oid:2.16.840.1.113883.6.1 works but 2.16.840.1.113883.6.1 to http://loinc.org is much better
CDA Logical Model and StructureMap resources Lots of good mapping detail
© 2016 HL7 ® International and Lantana Consulting Group. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
17
Terminology Mapping
The elephant in the room Use ConceptMap resources where they
exist; build them where they don’t Can get very expensive when local codes are
involved Commercial Terminology Service? Decide if all that coding is really necessary
Maybe plain text is good enough for your use case
© 2016 HL7 ® International and Lantana Consulting Group. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
18
Bundling It All Up
Do it yourself. Conversion code creates the Bundle resource. Need to make sure that type=document, Bundle.id
is globally unique, all references are contained in the Bundle, etc.
Let a FHIR server do it for you. POST the Composition and other resources to a
FHIR server as you are converting, then just call $document at the end.
Side benefit: incremental validation
© 2016 HL7 ® International and Lantana Consulting Group. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
19
When things go wrong…
What you expect What you get
© 2016 HL7 ® International and Lantana Consulting Group. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
20
CDA Quality Report (QRDA-I) Submission Statistics
Submission Year Total Files Files that passed validation
Successful Submitters
2014 237097 54795 14
2015 (partial) 82481 4495 17
77% of submissions were invalid in 2014, and 95% at the start of 2015 after minor implementation guide changes
© 2016 HL7 ® International and Lantana Consulting Group. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
21
But hope is not lost… More like a recycling center than a
dump Many validation errors are minor and
easily correctable Old template IDs Whitespace where not allowed Misnamed attributes (displayname vs.
displayName) Missing classCode and typeCode Missing elements that can be nulled Knowing the target (document level
templateId), you know the intent and can often apply corrections.
Others are more difficult Local codes instead of those required
by C-CDA
© 2016 HL7 ® International and Lantana Consulting Group. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
22
Real-World CDA to FHIR Conversion
Pre-Process
Validate
Transform
Map Terms
Post-Process
Validate
The amount of pre/post processing will depend on many factors, such as the quality of input data and the capabilities of your transformation tools.
You may need separate pre-processors for each source system.
Whatever you do, don’t forget to validate both input and output so you know what you are getting and what you are producing.
© 2016 HL7 ® International and Lantana Consulting Group. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
23
Going from FHIR to CDA Bundle = ClinicalDocument Composition = CDA Header + Sections Resources and Profiles become templates Rename fields Map data types References become nested elements XHTML to CDA narrative
Potential loss of some formatting What to do with Composition.text?
Lots of structural stuff to add classCode, moodCode, etc.
When in doubt, use the CDA Example Task Force data http://wiki.hl7.org/index.php?title=CDA_Example_Task_Force
© 2016 HL7 ® International and Lantana Consulting Group. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
24
CDA Example Task Force
No known allergies: 50+ lines of C-CDA XML
© 2016 HL7 ® International and Lantana Consulting Group. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
25
Open Source C-CDA on FHIR Transforms Coming Bi-directional C-CDA to FHIR XSLT transforms
Under development as part of an ONC High Impact Pilot (HIP) grant
Initial focus will be on the Electronic Pharmacist Care Plan (ePhCP) Based on C-CDA on FHIR, so will cover most of the basics US Realm Header, many DAF profiles, etc.
Intended to evolve over time, contributions welcome Not available yet
Q1/Q2 2017
© 2016 HL7 ® International and Lantana Consulting Group. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
26
ONC-HIP ePhCP Pilot
CCNC (CDA)
Vendor 1 (FHIR)
Vendor 2 (CDA)
Vendor 3 (CDA)
FHIR/CDA Conversion
CCNC: Community Care of North Carolina
© 2016 HL7 ® International and Lantana Consulting Group. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
27
Live Demo
My hackathon project CDA -> DSTU1 -> STU3
© 2016 HL7 ® International and Lantana Consulting Group. Licensed under Creative Commons. HL7 & Health Level Seven are registered trademarks of Health Level Seven International. Reg. U.S. TM Office.
28
Questions?