HL7 / fhir-ig-publisher

Source code for the IG publisher
Apache License 2.0
68 stars 56 forks source link

Publisher complains about embedded conceptmap in FML #875

Open cjmamo opened 5 months ago

cjmamo commented 5 months ago

When targeting FHIR 4.0.1, the publisher complains about embedded concept maps in FML scripts:

Core Package hl7.fhir.r4.core#4.0.1
Terminology Cache Version has changed from 1 to 4, so clearing txCache
Terminology Cache Version has changed from 1 to 4, so clearing txCache
Running Terminology Log: /tmp/ohfu-fhir-ig-17903603370256761562.log
Connect to Terminology Server at http://tx.fhir.org                                                  (00:01.660 / 00:12.378, 321Mb)
Load Package hl7.fhir.pubpack#0.1.7
Load Package hl7.fhir.xver-extensions#0.1.0
Load Package hl7.terminology.r4#5.3.0
Load Package hl7.fhir.uv.extensions.r4#1.0.0
Version mismatch. This IG is version 4.0.1, while the IG 'hl7.fhir.uv.tools' is from version 5.0.0 (will try to run anyway) (00:03.527 / 00:15.905, 497Mb)
Load Package hl7.fhir.uv.tools#0.1.0
Load R5 Specials
Initialization complete                                                                              (00:00.310 / 00:16.216, 388Mb)
Fetch https://paho.org/fhir/esavi/package-list.json for version check                                (00:00.001 / 00:16.217, 388Mb)
Load Content                                                                                         (00:00.908 / 00:17.126, 392Mb)
Exception in thread "main" java.lang.Error: Unrecognised name relationship on target
        at org.hl7.fhir.r5.elementmodel.Element.makeElement(Element.java:565)
        at org.hl7.fhir.r5.elementmodel.FmlParser.parseConceptMap(FmlParser.java:188)
        at org.hl7.fhir.r5.elementmodel.FmlParser.parse(FmlParser.java:102)
        at org.hl7.fhir.r5.elementmodel.FmlParser.parse(FmlParser.java:54)
        at org.hl7.fhir.igtools.publisher.SimpleFetcher.scan(SimpleFetcher.java:397)
        at org.hl7.fhir.igtools.publisher.Publisher.loadResources(Publisher.java:5199)
        at org.hl7.fhir.igtools.publisher.Publisher.load(Publisher.java:4302)
        at org.hl7.fhir.igtools.publisher.Publisher.createIg(Publisher.java:1140)
        at org.hl7.fhir.igtools.publisher.Publisher.execute(Publisher.java:990)
        at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:12445)

The FML I have is like this:

map "http://hl7.org/fhir/StructureMap/TrackedEntityToBundle" = "Tracked Entity to Bundle Conversion"

conceptmap "SexOptionSet" {
    prefix s = "http://paho-dhis2.org/"
    prefix t = "http://hl7.org/fhir/administrative-gender"

    s:"1" == t:"male"
    s:"2" == t:"female"
    s:"3" == t:"other"
}

conceptmap "MonitoreoPostVacunaValueType" {
    prefix s = "http://paho-dhis2.org/"
    prefix t = "https://paho.org/fhir/esavi/CodeSystem/RespuestaSiNoNosabeCS"

    s:"true" == t:"1"
    s:"false" == t:"2"
}

...
...

This error happens on the latest version of the publisher but it can also be reproduced on older releases. Note: this error could not be reproduced when compiling the script to a StructureMap using the latest release of validator_cli.jar.

lmckenzi commented 5 months ago

If this is a syntax error, should fail more gracefully. If syntax is valid, should work.