Transform FHIR Coverage instances - from version 1.4 to R4 using:
- instance of v1.4 Coverage
- FHIR mapping language - see coveragev14toR4.map
- transform operation on Matchbox server - see test http file
- no 'out of the box' support for FHIR 1.4, therefore in an attempt to circumvent this, the respective StructureDefinitions were obtained and used (note- not sure if this approach is valid/workable, but we are giving it a try)
-
Coverage v1.4 StructureDefinition
- downloaded from the FHIR spec here https://hl7.org/fhir/2016May/coverage.profile.xml.html
- updated the following elements to identify and differentiate as v1.4
StructureDefinition.id
toCoveragev14
StructureDefinition.url
tohttp://example.org/fhir/StructureDefinition/Coveragev14
StructureDefinition.name
toCoveragev14
- saved here: StructureDefinition-coverage-v14.xml
- POSTed to matchbox using this REST request
-
Coverage R4 StructureDefinition
- downloaded from the FHIR spec here https://hl7.org/fhir/R4/coverage.profile.xml.html
- updated the following elements to identify and differentiate as R4
StructureDefinition.id
toCoverageR4
StructureDefinition.url
tohttp://example.org/fhir/StructureDefinition/CoverageR4
StructureDefinition.name
toCoverageR4
- saved here: StructureDefinition-coverage-R4.xml
- POSTed to matchbox using this REST request
-
FML map file
- created FML file: coveragev14toR4.map
- Added the above 2 URLs into the map file as source and target (see here)
- added FML rules to transform various v1.4 elements to respective R4 elements
-
v1.4 example Coverage instance
- an example from the v1.4 FHIR specification was downloaded to use as the input to the transform
- saved here
- a couple of optional elements not present were added in order to invoke the respective rule (ie
network
andcontract
)
-
Transform operation
- issued the transform operation with this REST request
-
Transform result
- an instance of Coverage is successfully generated, however there are some gaps - see below
Transformed output
<?xml version="1.0" encoding="UTF-8"?>
<Coverage xmlns="http://hl7.org/fhir">
<identifier>
<system value="http://benefitsinc.com/certificate"/>
<value value="12345"/>
</identifier>
<dependent value="1"/>
<period>
<start value="2014-05-23"/>
<end value="2012-05-23"/>
</period>
<network value="test"/>
<contract>
<reference value="Contract/4"/>
<display value="Contract no 4"/>
</contract>
</Coverage>
-
Coverage.issuerReference
->Coverage.payor
- v1.4
Coverage.issuerReference
is member of choice groupCoverage.issuer
and is of datatypeReference
- R4
Coverage.payor
is of datatypeReference
- a number of rule variations have not yet yielded a successful transform
- note that a transform of
Coverage.contract
->Coverage.contract
(also datatypeReference
) does yield success
- v1.4
-
Coverage.beneficiaryReference
->Coverage.beneficiary
- as datatype
Reference
- same issue as above
- as datatype
-
Datatype transform
Coding
toCodeableConcept
- cannot figure out how to transform these elements:
Coverage.type
(Coding) ->Coverage.type
(CodeableConcept)Coverage.relationship
(Coding) ->Coverage.relationship
(CodeableConcept)
- see rule attempt here
- cannot figure out how to transform these elements: