Conversion of a FHIR resource from STU3 to R4

115 views
Skip to first unread message

laksh...@gmail.com

unread,
Aug 5, 2019, 4:29:55 PM8/5/19
to FHIR DOTNET
Hello,
What is the best way to convert a FHIR resource (say AllergyIntolerance) from STU3 to R4?

My input is an STU3 resource in Json format and I would like be able to convert to R4 json resource.

If I use the HL7.Fhir.R4 library and call this:

var parser = new FhirJsonParser(new ParserSettings { AcceptUnknownMembers = true, AllowUnrecognizedEnums = true });
Bundle b = parser.Parse<Bundle>(previousJson.ToString(Formatting.None));

I get this exception:
System.FormatException: 'Type checking the data: Since type CodeableConcept is not a primitive, it cannot have a value'

I was working with AllergyIntolerance resource and I think the reason this error is being thrown is because VerificationStatus and ClinicalStatus are of type Code in STU3, but CodeableConcept
in R4.

We are writing FHIR server (it is more like a facade) and would like to support multiple versions and I am trying to figure out the best way to do so. 

Any help is appreciated.
Thank you.
Reply all
Reply to author
Forward
0 new messages