Stream: implementers
Topic: Convert json data into FHIR resource
Ravishankar P (May 16 2021 at 05:51):
Hi All,
i'm creating POC in java to convert JSON data into FHIR Patient resource, if anyone already done this is in java, please share your code, it will really helpful to me.
Step 1: Need to create StructureMap
Step 2: Convert StructureMap into Patient Resource
Lloyd McKenzie (May 16 2021 at 19:19):
You might ask on the #mapping-framework stream. However, I don't think StructureMap will convert arbitrary JSON - at least not without some extra wrapping work on the front end.
Oliver Egger (May 17 2021 at 05:46):
@Ravishankar P if you want convert arbitray JSON data with a StructureMap you need to create a FHIR Logical Model for your input data, assuming that you have primitive types in your arbitrary json as defined in FHIR.
Ravishankar P (May 17 2021 at 05:57):
Oliver Egger said:
Ravishankar P if you want convert arbitray JSON data with a StructureMap you need to create a FHIR Logical Model for your input data, assuming that you have primitive types in your arbitrary json as defined in FHIR.
@Oliver Egger Actually i have a structureMap in the JSON format, and i'm looking for Mapping engine which can take input as structureMap and convert that into the Patient resource .
Oliver Egger (May 17 2021 at 06:00):
and you have a Logical Model definition of your input? You need do describe your input with StructureDefinitions that you can apply the StructureMap to your input data.
Ravishankar P (May 17 2021 at 06:04):
Oliver Egger said:
and you have a Logical Model definition of your input? You need do describe your input with StructureDefinitions that you can apply the StructureMap to your input data.
@Oliver Egger i have created StructureMap for my JSON data, now i need to convert into FHIR PAtient resource, could you please tell me the steps i need to follow ??
Oliver Egger (May 17 2021 at 06:21):
- Can you post your input example?
- You need to define a Logical Model (StructureDefinition) for your input data
- You run the transform e.g. with the java validator or another tooling
Ravishankar P (May 17 2021 at 06:24):
Oliver Egger said:
- Can you post your input example?
- You need to define a Logical Model (StructureDefinition) for your input data
- You run the transform e.g. with the java validator or another tooling
Ravishankar P (May 17 2021 at 06:25):
Ravishankar P said:
Oliver Egger said:
- Can you post your input example?
- You need to define a Logical Model (StructureDefinition) for your input data
- You run the transform e.g. with the java validator or another tooling
@Oliver Egger i will explain my complete requirement here .
i will get some patient data from third party API, that data is not in FHIR format, i need to convert that data into the FHIR patient resource.
for above requirement what all thing i need to do, i'm new to FHIR framework, please explain me step by step
Oliver Egger (May 17 2021 at 06:34):
did you check out the FHIR DevDays tutorials about the FHIR Mapping Language: https://www.youtube.com/watch?v=Q8F3Ae2_Qyw&list=PLKuZNI94tzWZ4zseQ2NLU7mLDdgmQlS5a&index=66 and https://www.youtube.com/watch?v=mOflu1URYTM&list=PLKuZNI94tzWZ4zseQ2NLU7mLDdgmQlS5a&index=35 . There is also the FHIR Connectathon with has FHIR Mapping Language track and upcoming DevDays which cover these topcis.
Kevin Mayfield (May 17 2021 at 07:22):
Do you need to use a FHIR StructureMap?
I would be tempted to convert using using java code and HAPI FHIR.
That depends on your long term view on conversion. If this is going to be one of many, I would consider using some tooling to do the conversion (this may output/use a StructureMap). That may allow non developers to work on the conversions (and was often the approach in v2).
I would be tempted for this first conversion to code it, especially as you are using java and it is highly likely you will also use HAPI FHIR.
Kevin Mayfield (May 17 2021 at 07:23):
That gets you familiar with FHIR first.
Ravishankar P (May 17 2021 at 10:52):
Oliver Egger said:
did you check out the FHIR DevDays tutorials about the FHIR Mapping Language: https://www.youtube.com/watch?v=Q8F3Ae2_Qyw&list=PLKuZNI94tzWZ4zseQ2NLU7mLDdgmQlS5a&index=66 and https://www.youtube.com/watch?v=mOflu1URYTM&list=PLKuZNI94tzWZ4zseQ2NLU7mLDdgmQlS5a&index=35 . There is also the FHIR Connectathon with has FHIR Mapping Language track and upcoming DevDays which cover these topcis.
Using StructureMapUtils can i convert into FHIR resource ?
Lloyd McKenzie (May 17 2021 at 17:55):
StructureMap requires that the content be exposed as a StructureDefinition instance. You'll have to define such a model and write code to turn your arbitrary JSON into an in-memory logical model instance before StructureMap can do anything with it.
Richard Stanley (May 18 2021 at 11:49):
Interesting. Is there a very simple worked example of this?
Oliver Egger (May 18 2021 at 12:41):
we have one not for json but for xml, Logical Model and then the map which converts the xml to a bundle. we do the same apporach with the CDA Logical model, but this is definetly not simple anymore :-)
Richard Stanley (May 18 2021 at 13:20):
Thanks @Oliver Egger that's very interesting and helpful. Indeed, not simple :) If others come to this thread, please do point us to a minimum working example if possible (think StackOverflow) if you can :)
Craig McClendon (May 18 2021 at 14:56):
Google's open source data harmonization engine could be another option for JSON to JSON transformation.
https://github.com/GoogleCloudPlatform/healthcare-data-harmonization
Last updated: Apr 12 2022 at 19:14 UTC