Data Mapping
Ilya Beda
CTO at Beda Software
whoami
Ilya Beda
CTO Beda Software
8 year of HealthcareοΏ½ Software Development
CTO Beda EMR
_
What is the Mapper?
What mapper consists of
How we query source data (path engine)
How we generate/validate target data
Data mapping is a Hot Topic
Why kind of mapping we are going to explore
π₯ FHIR | β | π οΈ Legacy |
π οΈ Legacy | β | π₯ FHIR |
π₯ FHIR | β | π₯ FHIR |
π₯ FHIR β π οΈ
How we query source data (path engine)
FHIRPath
How we generate/validate target data
Depends on target format
π οΈ β π₯ FHIR
How we query source data (path engine)
π οΈ β π₯ FHIR
How we query source data (path engine)
We still can use FHIRPath to query any JSON
FHIRPath for non-FHIR data example
Non JSON friendly data
HL7v2
JSON representation
MSH|^~\&|App|Facility|||20190423113910||ADT^A08|8899-39|P|2.3|||
PID|1||151||Name^Family||19990723|M||||||||||151||||||||||||N
JSON representation
{
"parsed": {
"message": {
"sender": { "app": "App", "facility": "Facility" },
"datetime": "2019-04-23T11:39:10",
"type": { "code": "ADT", "event": "A08" },
"id": "8899-39", "proc_id": { "id": "P" },
"version": { "id": "2.3" }
},
"patient_group": {
"patient": { "identifier": [ { "value": "151" } ], "name": [ { "use": "official", "family": "Name", "given": [ "Family" ] } ],
"birthDate": "1999-07-23", "gender": "M", "account": { "identifier": { "value": "151" } }, "death": { "indicator": "N" }
}
}
}
}
π οΈ β π₯ FHIR
How we query source data (path engine)
We still can use FHIRPath to query any JSON
How we generate/validate target data
StructureDefinition
π₯ FHIR β π₯ FHIR
How we query source data (path engine)
FHIRPath
How we generate/validate target data
StructureDefinition
π₯ FHIR β π₯ FHIR
SDC extraction
Migrate from one version of FHIR to another
Hormanization and normalization when integrate with many EHRs
Letβs see what we already have
What is important?
π₯ Path engine
π₯ How result is described/validated
π§βπ» Who lead the development
ποΈ Are there any open source implementations
π» What type of DSL is it
π License
What is important for me?
π» Readability
π Spot an Error ASAP
Criteria
Top Secret
Example
We convert QuestionnaireResponse of patient phone numbers into bundle transaction that patches the patient.
github.com/beda-software/FHIRPathMappingLanguage/blob/main/examples/repeatable/qr.json
github.com/beda-software/FHIRPathMappingLanguage/blob/main/examples/repeatable/result.json
FHIR Mapping Language
FHIR Mapping Language
FHIRPath are path engine
Structure definition to validate result
Driven by FHIR Community
External SDL
FHIR Mapping Language
Various opens source implementations
BSD 3-Clause License
https://github.com/brianpos/fhir-net-mappinglanguage
Apache License 2.0
https://github.com/ahdis/matchbox/tree/main
Apache License 2.0
FHIR Mapping Language
External DSL
JUTE
Data DSL
JUTE
Its own path engine, but you can add custom functions and add FHIRPath
The result is YAML encoded data-structure
Driven by Health Samurai
Data SDL
Implemented with Clojure
MIT License
FUME
FUME
JSONata path engine
Structure definition to validate result
Driven by Outburn
FSH inspired DSL
Implemented with TypeScript
GNU Affero General Public License v3.0
Pydian
Pydian
JMESPath as path engine
Python dicts
Driven by Eric Pan
Embedded python DSL
Implemented with Python
MIT License
Pure python with Beda Software tooling
Fhirpath-py (python dsl) + fhir-py-types (pydantic)
github.com/beda-software/FHIRPathMappingLanguage/blob/main/python/bs_repeatable.py
Pure python with Beda Software tooling
FHIRPath as path engine
Pydantic schemas
Driven by Beda Software
Embedded python DSL
Implemented with Python
MIT License
Why we still need a data DSL?
Store code as a data for your system
FHIRPathMappingLanguage
Reuse as many as we can from FHIR
x-fhir-query inspired usage of liquid template language
Data DSL β the target is described by shape of the data format
FHIRPathMappingLanguage
FHIRPathMappingLanguage
FHIRPath as path engine
No schema validation yet
Driven by Beda Software
Data DSL
Implemented with TypeScript
MIT License
There is one more advantage of Data DSL
Data DSL isοΏ½LLM friendly format
What is important for me?
π» Readability
π Spot Error ASAP
π¬ Easy to generate with LLM
How does it works
Thank you