Stream: implementers
Topic: Downloadable mCODE definitions do not pass validation
John Timm (Mar 19 2020 at 16:05):
I recently downloaded the mCODE JSON definitions from here:
http://hl7.org/fhir/us/mcode/STU1/definitions.json.zip
And what I found is that much of the generated XHTML content in Narrative text contain template URLs that looks like this:
<a href=\"{{[type]}}-{{[id]}}-definitions.html#Observation\">Observation</a>
This causes validation errors:
Unable to add: StructureDefinition-mcode-karnofsky-performance-status.json to the index due to exception: Invalid XHTML content: cvc-datatype-valid.1.2.1: '{{[type]}}-{{[id]}}-definitions.html#Observation' is not a valid value for 'anyURI'. [StructureDefinition.text]
The JSON definitions that are inline on the spec website don't appear to have the same issue. I'm guessing that there is a find/replace step that didn't happen in generating the JSON definition package.
I also tried downloading the full IG site and the definitions.json.zip file contained within that also has the issue.
Is this a tooling problem?
URI uri = new URI("{{[type]}}-{{[id]}}-definitions.html#Observation");
yields the following exception:
java.net.URISyntaxException: Illegal character in path at index 0: {{[type]}}-{{[id]}}-definitions.html#Observation
It doesn't like the curly braces or the square braces. Escaping them using the proper character entity references seems to alleviate the problem but I think the fix is that these values should be replaced with the actual type and id values that were intended.
The downloadable XML definitions suffer from the same problem.
Grahame Grieve (Mar 19 2020 at 17:39):
this is not exactly a tooling problem. But I'm not sure what to do about it
Halina Labikova (Mar 19 2020 at 17:44):
@May Terry @Mark Kramer
John Timm (Mar 19 2020 at 18:08):
I also found an issue with an Id value in the ImplementationGuide resource itself
Unable to add: ImplementationGuide-hl7.fhir.us.mcode.json to the index due to exception: Id value: '_str_abstractprofile' contain invalid character '_' [ImplementationGuide.definition.resource[0]]
John Timm (Mar 19 2020 at 18:18):
I have created the following ticket to track this issue:
https://jira.hl7.org/projects/FHIR/issues/FHIR-26611
Grahame Grieve (Mar 23 2020 at 19:02):
I just spent some time looking at this - this is not a feature of the current mcode ig, and I con't figure out how it was produced
Mark Kramer (Mar 24 2020 at 12:52):
@Grahame Grieve Is there anything we (mCODE) should be doing to address this problem?
John Timm (Mar 24 2020 at 14:09):
@Mark Kramer @Grahame Grieve at some point during the IG authoring/publication process it seems like there is a find/replace that needs to happen. For our purposes, we ended up post-processing the JSON definitions by replacing instances of the pattern {{[type]}}-{{[id]}}
in the XHTML content with the actual type name and id (e.g. StructureDefinition-mcode-cancer-condition-patient
) for each artifact. That's our current "workaround".
Grahame Grieve (Mar 24 2020 at 19:08):
@Mark Kramer it doesn't happen in the current version, so no, you don't need to do anything. I'm not sure whether the problem in the past published version is something I need to do anything about. the {{[type]}}-{{[id]}} syntax is something that is processed in templates but I don't think there's any reason for it to be in resources. James, @Mark Iantorno and I spent 20 minutes looking at this and couldn't figure out whether there's a valid reason for this to appear, but I will beef up URL validation
Chris Moesel (Mar 24 2020 at 19:31):
@Grahame Grieve -- would it be worth re-publishing the mCODE package so that people like @John Timm don't have to implement a workaround like he described above?
Grahame Grieve (Mar 24 2020 at 20:25):
maybe. I'm not sure how to evaluate the 'worth' there - John's already worked around it...
Grahame Grieve (Mar 24 2020 at 20:25):
what I do know is: I don't have time right now :-(
John Timm (May 01 2020 at 15:26):
FYI @Chris Moesel @Grahame Grieve unfortunately, the examples share the same fate as the definitions.
Grahame Grieve (May 01 2020 at 21:07):
I have fixed additional bugs here, so I could issue a technical correction. but I can only do so if the committee requests it and gets internal approval
Chris Moesel (May 04 2020 at 16:03):
@Mark Kramer -- see above. You may want to start a process to get a technical correction to fix these issues in mCODE.
Mark Kramer (May 04 2020 at 18:43):
@Grahame Grieve Which committee?
Grahame Grieve (May 04 2020 at 19:24):
mCode itself says CIC owns it, so it would be CIC. Of course, the issue here is a purely publishing one, so they may not really understand. That can be a challenge with the domain committees.
Grahame Grieve (May 04 2020 at 19:24):
but I don't believe with a process to side-step the owning committee even for purely technical issues.
Last updated: Apr 12 2022 at 19:14 UTC