Stream: IG creation
Topic: The resource should declare its jurisdiction to match the pa
Carl Anderson (Jul 18 2020 at 08:18):
Sharing this for posterity (I didn't find anything relevant searching through Zulip history).
I saw this warning in qa.html
:
The resource should declare its jurisdiction to match the package id (hl7.fhir.uv.smart-web-messaging, jurisdiction = http://unstats.un.org/unsd/methods/m49/m49.htm#001: World)
I thought, no problem - I'll use that value in my sushi config.yaml
and rebuild. Unfortunately, that didn't quite work.
I added this line:
jurisdiction: http://unstats.un.org/unsd/methods/m49/m49.htm#001: World
Rebuilding gave me this sushi error:
error Error parsing configuration: Nested mappings are not allowed in compact mappings.
File: fsh/config.yaml
Unfortunately, I didn't see the simple fix right away due to unfamiliarity with the URN code systems. I tried all kinds of silly things before I recognized that what I needed was very close to what the error suggested.
This works:
jurisdiction: http://unstats.un.org/unsd/methods/m49/m49.htm#001 "World"
A better suggestion in the error message would have saved me some time, so I looked into the publisher code hoping to find a suggestion for an edit. I found this line of code, which was taken from this method:
private void checkJurisdiction(FetchedFile f, CanonicalResource resource, IssueSeverity error, String verb) {
if (expectedJurisdiction != null) {
boolean ok = false;
for (CodeableConcept cc : resource.getJurisdiction()) {
ok = ok || cc.hasCoding(expectedJurisdiction);
}
if (!ok) {
f.getErrors().add(new ValidationMessage(Source.Publisher, IssueType.BUSINESSRULE, resource.fhirType()+".jurisdiction", "The resource "+verb+" declare its jurisdiction to match the package id ("+npmName+", jurisdiction = "+expectedJurisdiction.toString()+")",
error).setMessageId(I18nConstants.RESOURCE_JURISDICTION_MISMATCH));
}
}
I spent a few minutes digging in to how the toString
logic works for expectedJurisdiction
, which is an o.h.f.r5.model.Coding
, but I can't follow it just by browsing on GitHub.
Anyway, I don't see a clean way to transform the jurisdiction hint from http://unstats.un.org/unsd/methods/m49/m49.htm#001: World
to http://unstats.un.org/unsd/methods/m49/m49.htm#001 "World"
without doing something hacky in the publisher code.
I did submit an issue to track this: https://github.com/HL7/fhir-ig-publisher/issues/135
Last updated: Apr 12 2022 at 19:14 UTC