FHIR Chat · convert resource format from R3 to R4 · IG creation

Stream: IG creation

Topic: convert resource format from R3 to R4


view this post on Zulip Oliver Egger (Sep 23 2019 at 20:52):

During the WGM I was asked how I converted my R3 resources. I expose a $convert operation on our server which allows to update ig resources to the newer version. With RESTClient (VSCode) it works the following way:

@host = https://test.fhir.ch/r4

### Convert between XML STU3 to XML R4
POST {{host}}/$convert HTTP/1.1
Accept: application/fhir+xml;fhirVersion=4.0
Content-Type: application/fhir+xml;fhirVersion=3.0

<StructureDefinition xmlns="http://hl7.org/fhir">
  <fhirVersion value="3.0.1"/>
</StructureDefinition>

Please note that it converts only the format itself, so a profile which applies to a R3 resource needs to be adjusted for R4.

view this post on Zulip Grahame Grieve (Sep 23 2019 at 20:53):

That'll work... though you don't actually need to do that; the IG Publisher can do what ever conversion is needed internally (though like yours , it doesn't do the adjustment)

view this post on Zulip Oliver Egger (Sep 23 2019 at 21:00):

I had in memory that the IG Publisher uses the VersionConverter_xx.java for transformation, using the R3R4 maps I had a that time (a few months ago) better conversion for the Medication Resource samples I wanted to transforrm, for the conformance resources itself there was no difference.

view this post on Zulip Grahame Grieve (Sep 23 2019 at 21:01):

yes the maps are better for non-conformance resources, that's true.

view this post on Zulip Grahame Grieve (Sep 23 2019 at 21:01):

so it doesn't convert them

view this post on Zulip Oliver Egger (Sep 23 2019 at 21:05):

sorry, i intended to point out first that it is a mapbased conversion, i forgot that (jetlag ..), why do mean it does not convert them?

view this post on Zulip Grahame Grieve (Sep 23 2019 at 21:06):

the IG publisher only upconverts conformance resources - StructureDefinition, ValueSet, CodeSystem etc. It leaves the other resources exactly as it finds them

view this post on Zulip Oliver Egger (Sep 23 2019 at 21:06):

thanks for clarification!


Last updated: Apr 12 2022 at 19:14 UTC