FHIR Chat · Understanding STU3 -> R4 map for DocumentReference · mapping-framework

Stream: mapping-framework

Topic: Understanding STU3 -> R4 map for DocumentReference


view this post on Zulip Morten Ernebjerg (Jan 13 2020 at 09:22):

I'm looking at the STU3 -> R4 map for DocumentReference (on Github) and cannot quite understand the mapping rule for the reference field "author". According to the diff summary, all that has changed for this field is that one can now also reference PractitionerRole. But the mapping rule is the following:

src.author as s -> tgt.agent as t then agent(s, t);
(...)
group agent(source src, target tgt) extends BackboneElement {
  src ->  tgt.type as cc,  cc.coding as c,  c.system = 'http://terminology.hl7.org/CodeSystem/v3-ParticipationType',  c.code = 'AUT' "author";
  src -> tgt.who as vt0 then Reference(src, vt0) "who";
}

Why is this needed?

view this post on Zulip Lloyd McKenzie (Jan 13 2020 at 15:00):

@Grahame Grieve

view this post on Zulip Grahame Grieve (Jan 14 2020 at 02:31):

looks like an error to me

view this post on Zulip Morten Ernebjerg (Jan 14 2020 at 07:29):

Should I put in a change request or is it easier "off the books"?

view this post on Zulip Johannes Oehm (Jan 14 2020 at 15:54):

@Morten Ernebjerg I'm curious if You could execute the migration scripts from the github repository? I'm also in the process of learning the mapping language and tried to get a Patient mapping running, but when I try to run anything but an empty Resource, a get various errors for the different datatypes

view this post on Zulip Morten Ernebjerg (Jan 15 2020 at 09:07):

@Johannes Oehm I actually haven't tried to run the mapping yet - I was looking it at to get a better understanding of what STU3 -> R4 transformation of resources involves.

view this post on Zulip Oliver Egger (Jan 17 2020 at 20:56):

hi @Johannes Oehm you should be able to execute the maps directly via the validator, for an example see the fhir tutorial with the java validator or with a local setup

view this post on Zulip Johannes Oehm (Jan 20 2020 at 14:05):

@Oliver Egger Yes, I also tried your patched version of the FHIR validator, but I'm getting the following message:
C:\Users\oehmj\VSCodeProjects\fhir-mapping-tutorial> java -jar org.hl7.fhir.validator.jar C:\Users\oehmj\IdeaProjects\org.hl7.fhir.core\patient.fhir.json -transform http://hl7.org/fhir/StructureMap/Patient4to3 -version 4.0.1 -ig ..\fhir-mapping\R4toR3\ -log test.txt -output ./r4tor3out.xml
FHIR Validation tool Version 4.1.38-SNAPSHOT (Git# 363b38be9bc0). Built 2020-01-05T21:22:05.612+01:00 (14 days old)
Detected Java version: 1.8.0_241 from C:\Program Files\Java\jre1.8.0_241 on amd64 (64bit). 2711MB available
Arguments: C:\Users\oehmj\IdeaProjects\org.hl7.fhir.core\patient.fhir.json -transform http://hl7.org/fhir/StructureMap/Patient4to3 -version 4.0.1 -ig ..\fhir-mapping\R4toR3\ -log test.txt -output ./r4tor3out.xml
Directories: Current = C:\Users\oehmj\VSCodeProjects\fhir-mapping-tutorial, Package Cache = C:\Users\oehmj\.fhir\packages
.. FHIR Version 4.0, definitions from hl7.fhir.r4.core#4.0.1
.. connect to tx server @ http://tx.fhir.org
(v4.0.1)

  • .. load IG from ..\fhir-mapping\R4toR3\
    ...Failure: Unable to determine StructureDefinition for target type
    org.hl7.fhir.exceptions.FHIRException: Unable to determine StructureDefinition for target type
    at org.hl7.fhir.r5.validation.ValidationEngine.getTargetResourceFromStructureMap(ValidationEngine.java:1260)
    at org.hl7.fhir.r5.validation.ValidationEngine.transform(ValidationEngine.java:1234)
    at org.hl7.fhir.r5.validation.ValidationEngine.transform(ValidationEngine.java:1222)
    at org.hl7.fhir.r5.validation.Validator.main(Validator.java:592)

The official version of the Validator gets into an NPE when it's trying to load the maps vom the ImplementationGuide, I also tried a local fix for that problem, but then imports in the mapping script seem to be unresolved.

view this post on Zulip Oliver Egger (Jan 23 2020 at 19:04):

Hi @Johannes Oehm sorry that was maybe a misunderstanding, executing the mappings for version conversion R4toR3 is not directly possible with the java validator. The fhir java build uses the maps to transform them, but adjusts the StructureDefinitions that multiple versions are possible.

view this post on Zulip Grahame Grieve (Mar 03 2020 at 06:57):

see https://confluence.hl7.org/display/FHIR/Using+the+FHIR+Validator#UsingtheFHIRValidator-VersionConversion for new instructions


Last updated: Apr 12 2022 at 19:14 UTC