Stream: IG creation
Topic: unable to find Invariant error with invariant in spreadsheet
Rob Hausam (Aug 16 2018 at 19:50):
In LIVD we have an invariant on ConceptMap.group.element.target.dependsOn, but when the invariant id is added for the element the IG build complains, even though the invariant is there and should be findable:
[java] Initialization complete (16.0103sec) [java] Load Content (16.0103sec) [java] java.lang.Exception: exception parsing pack /Users/rhausam/git-repo/livd/src/resources/conceptmap-uv-livd-spreadsheet: unable to find Invariant '4' /Users/rhausam/git-repo/livd/src/resources/conceptmap-uv-livd-spreadsheet, sheet "conceptmap-uv-livd", row 33 [java] at org.hl7.fhir.igtools.spreadsheets.IgSpreadsheetParser.parse(IgSpreadsheetParser.java:208) [java] at org.hl7.fhir.igtools.publisher.Publisher.loadSpreadsheet(Publisher.java:1905) [java] at org.hl7.fhir.igtools.publisher.Publisher.loadSpreadsheets(Publisher.java:1890) [java] at org.hl7.fhir.igtools.publisher.Publisher.load(Publisher.java:1601) [java] at org.hl7.fhir.igtools.publisher.Publisher.createIg(Publisher.java:513) [java] at org.hl7.fhir.igtools.publisher.Publisher.execute(Publisher.java:479) [java] at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:4622) [java] Caused by: java.lang.Exception: unable to find Invariant '4' /Users/rhausam/git-repo/livd/src/resources/conceptmap-uv-livd-spreadsheet, sheet "conceptmap-uv-livd", row 33 [java] Missing IsModifierReason on ConceptMap.group.element.target.equivalence [java] at org.hl7.fhir.igtools.spreadsheets.IgSpreadsheetParser.processLine(IgSpreadsheetParser.java:764) [java] at org.hl7.fhir.igtools.spreadsheets.IgSpreadsheetParser.parseProfileSheet(IgSpreadsheetParser.java:275) [java] at org.hl7.fhir.igtools.spreadsheets.IgSpreadsheetParser.parse(IgSpreadsheetParser.java:182) [java] ... 6 more [java] Exception in thread "main" java.lang.NullPointerException [java] at org.hl7.fhir.igtools.publisher.Publisher.main(Publisher.java:4632) [java] Publishing Content Failed: exception parsing pack /Users/rhausam/git-repo/livd/src/resources/conceptmap-uv-livd-spreadsheet: unable to find Invariant '4' /Users/rhausam/git-repo/livd/src/resources/conceptmap-uv-livd-spreadsheet, sheet "conceptmap-uv-livd", row 33 (16.0638sec) [java] (16.0639sec) [java] Use -? to get command line help (16.0639sec) [java] (16.0639sec) [java] Stack Dump (for debugging): (16.0639sec) BUILD FAILED /Users/rhausam/git-repo/livd/framework/build.xml:78: Java returned: 1
This is committed in the livd2 branch at https://github.com/HL7/livd/tree/livd2. Has anyone else encountered this?
Rob Hausam (Aug 16 2018 at 20:35):
I assume this is likely a bug? Will I need to remove the invariant id from the element for now and add a note that it is supposed to be there and will be corrected in the future? Or can it be fixed or is there something to correct on my end?
Grahame Grieve (Aug 16 2018 at 20:36):
it's on my list for next
Rob Hausam (Aug 16 2018 at 22:15):
Well, I think I can take it off your list. The answer seems to be that when you add the '-Inv' to the tab name for the invariants for that structure you must use a capital 'I'. I obviously should have tried that a bit sooner. :(
Grahame Grieve (Aug 16 2018 at 22:18):
ok
Patrick Werner (Oct 08 2019 at 16:10):
running into the same issue (i guess). My invariant tab is named: Invariants-Inv (also tried foo-INV, Invariant, Invariants).
These Invariants aren't found while parsing the spreadsheet causing a similar error.
Patrick Werner (Oct 08 2019 at 16:11):
How is the Invariant Tab discriminated by the Publisher? The Tab with a -Inv ending? couldn't find the naming conventions :-(
Lloyd McKenzie (Oct 08 2019 at 16:22):
It should have the same name as the profile. E.g. MyPatient-INV for invariants related to the MyPatient profile. (Every profile needs its own Invariant tab)
Patrick Werner (Oct 09 2019 at 10:04):
done. Now it seems to be linked, but i get the exception:
java.lang.Exception: exception parsing pack Observations: Profile finding Invariant null (As HGNC contains overlapping gene and gene-family IDs please use a more specific CodeSystem Uri.) has no XPath statement
I thought filling out the expression tab with FHIRpath should be sufficient?
Lloyd McKenzie (Oct 09 2019 at 14:51):
Still need XPath for R4. I think it goes away in R5
Patrick Werner (Oct 09 2019 at 16:34):
:pensive:
Patrick Werner (Oct 09 2019 at 16:39):
Still need XPath for R4. I think it goes away in R5
wait what? I just checked some profiles. For example german base profiles are using expression without XPath
Patrick Werner (Oct 09 2019 at 16:39):
Also elementDefinition has no constrain on constrain :smiley: to enforce Xpath.
Lloyd McKenzie (Oct 09 2019 at 19:31):
It may be a 'feature' of the spreadsheet extraction mechanism :( Not something I can dig into in the next couple of weeks unfortunately.
Grahame Grieve (Oct 10 2019 at 07:11):
yes that's a policy constraint for HL7 IGs - you need to provide an XPath expression as well (even though they are not universally required).
Patrick Werner (Oct 10 2019 at 09:51):
thanks for the explanations
Last updated: Apr 12 2022 at 19:14 UTC