1 of 42

Data Mapping

Ilya Beda

CTO at Beda Software

2 of 42

whoami

Ilya Beda

CTO Beda Software

8 year of HealthcareοΏ½ Software Development

CTO Beda EMR

_

3 of 42

What is the Mapper?

4 of 42

What mapper consists of

How we query source data (path engine)

How we generate/validate target data

5 of 42

Data mapping is a Hot Topic

6 of 42

Why kind of mapping we are going to explore

πŸ”₯ FHIR

β†’

πŸ› οΈ Legacy

πŸ› οΈ Legacy

β†’

πŸ”₯ FHIR

πŸ”₯ FHIR

β†’

πŸ”₯ FHIR

7 of 42

πŸ”₯ FHIR β†’ πŸ› οΈ

How we query source data (path engine)

FHIRPath

How we generate/validate target data

Depends on target format

8 of 42

πŸ› οΈ β†’ πŸ”₯ FHIR

How we query source data (path engine)

9 of 42

πŸ› οΈ β†’ πŸ”₯ FHIR

How we query source data (path engine)

We still can use FHIRPath to query any JSON

10 of 42

FHIRPath for non-FHIR data example

11 of 42

Non JSON friendly data

HL7v2

12 of 42

JSON representation

MSH|^~\&|App|Facility|||20190423113910||ADT^A08|8899-39|P|2.3|||

PID|1||151||Name^Family||19990723|M||||||||||151||||||||||||N

13 of 42

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" }

}

}

}

}

14 of 42

πŸ› οΈ β†’ πŸ”₯ FHIR

How we query source data (path engine)

We still can use FHIRPath to query any JSON

How we generate/validate target data

StructureDefinition

15 of 42

πŸ”₯ FHIR β†’ πŸ”₯ FHIR

How we query source data (path engine)

FHIRPath

How we generate/validate target data

StructureDefinition

16 of 42

πŸ”₯ FHIR β†’ πŸ”₯ FHIR

SDC extraction

Migrate from one version of FHIR to another

Hormanization and normalization when integrate with many EHRs

17 of 42

Let’s see what we already have

18 of 42

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

19 of 42

What is important for me?

πŸ’» Readability

πŸ”Ž Spot an Error ASAP

Criteria

Top Secret

20 of 42

Example

21 of 42

FHIR Mapping Language

22 of 42

FHIR Mapping Language

FHIRPath are path engine

Structure definition to validate result

Driven by FHIR Community

External SDL

23 of 42

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

https://github.com/hapifhir/org.hl7.fhir.core/

24 of 42

FHIR Mapping Language

External DSL

25 of 42

JUTE

26 of 42

Data DSL

It is a DSL that uses regular data structures to represent the code

FHIR Questionnaire

27 of 42

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

28 of 42

FUME

29 of 42

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

30 of 42

Pydian

31 of 42

Pydian

JMESPath as path engine

Python dicts

Driven by Eric Pan

Embedded python DSL

Implemented with Python

MIT License

32 of 42

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

33 of 42

Pure python with Beda Software tooling

FHIRPath as path engine

Pydantic schemas

Driven by Beda Software

Embedded python DSL

Implemented with Python

MIT License

34 of 42

Why we still need a data DSL?

Store code as a data for your system

35 of 42

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

36 of 42

FHIRPathMappingLanguage

37 of 42

FHIRPathMappingLanguage

FHIRPath as path engine

No schema validation yet

Driven by Beda Software

Data DSL

Implemented with TypeScript

MIT License

38 of 42

There is one more advantage of Data DSL

39 of 42

Data DSL isοΏ½LLM friendly format

40 of 42

What is important for me?

πŸ’» Readability

πŸ”Ž Spot Error ASAP

πŸ’¬ Easy to generate with LLM

41 of 42

How does it works

42 of 42

Thank you

Please go and star all repositories you saw today

youtube.com/@bedasoftware

ilya@beda.software