FHIR Chat · HAPI Validator Transformation · implementers

Stream: implementers

Topic: HAPI Validator Transformation


view this post on Zulip Lallu Anthoor (Sep 13 2019 at 08:58):

I'm trying to use the HAPI FHIR Validator to transform one Resource to another. I am using one of the provided StructureMap (ActivityDefinition to ServiceRequest) with the default tx server (http://tx.fhir.org), and an ActivityDefinition from HAPI server. I'm getting the following error:

$ java -jar org.hl7.fhir.validator.jar -debug -transform http://hl7.org/fhir/StructureMap/supplyrequest-transform -output OperationOutcome.xml -version 4.0.0 -log txlog.out input.json
FHIR Validation tool Version 4.0.5-SNAPSHOT - Built 2019-09-03T13:06:20.836+10:00 - Git bd382306624d
Arguments: -debug -transform http://hl7.org/fhir/StructureMap/supplyrequest-transform -output OO.xml -version 4.0.0 -log txlog.out ./input.json
  .. connect to tx server @ http://tx.fhir.org
  .. definitions from hl7.fhir.core#4.0.0
    (v4.0.0)
Start Transform http://hl7.org/fhir/StructureMap/supplyrequest-transform
Group : main; vars = source variables [source: (ActivityDefinition)], target variables [], shared variables []
  rule : status; vars = source variables [source: (ActivityDefinition)], target variables [], shared variables []
 ...Failure: Rule "status": target context not known: target
org.hl7.fhir.exceptions.FHIRException: Rule "status": target context not known: target
    at org.hl7.fhir.r5.utils.StructureMapUtilities.processTarget(StructureMapUtilities.java:1813)
    at org.hl7.fhir.r5.utils.StructureMapUtilities.executeRule(StructureMapUtilities.java:1406)
    at org.hl7.fhir.r5.utils.StructureMapUtilities.executeGroup(StructureMapUtilities.java:1393)
    at org.hl7.fhir.r5.utils.StructureMapUtilities.transform(StructureMapUtilities.java:1367)
    at org.hl7.fhir.r5.validation.ValidationEngine.transform(ValidationEngine.java:1036)
    at org.hl7.fhir.r5.validation.ValidationEngine.transform(ValidationEngine.java:1022)
    at org.hl7.fhir.r5.validation.Validator.main(Validator.java:459)

It would be of great help if anyone could help me figure this out.

Use-case: I'm trying to implement mapping/transformation between two FHIR profiles. The idea is to use StructureMap and HAPI Validator to achieve this.

Thanks!

view this post on Zulip Lloyd McKenzie (Sep 13 2019 at 11:05):

@Grahame Grieve

view this post on Zulip Grahame Grieve (Sep 13 2019 at 12:16):

it's on my list.

view this post on Zulip Grahame Grieve (Sep 13 2019 at 13:22):

hmm. there's a problem with the resource that means that the main group target has not beeen processed correctly

view this post on Zulip Grahame Grieve (Sep 13 2019 at 13:26):

I've added it to my technical correction list, which means that I'll be getting back to this the week after next

view this post on Zulip Lallu Anthoor (Sep 17 2019 at 15:51):

@Grahame Grieve @James Agnew I already have a pull request for this: https://github.com/hapifhir/org.hl7.fhir.core/pull/83


Last updated: Apr 12 2022 at 19:14 UTC