Stream: shorthand
Topic: fsh Usage: #inline resulting in broken links?
Matt Jenks (Mar 15 2022 at 22:03):
I'm creating an IG using FSH and attempting to clear out all of my ERRORS from my qa.txt.
I'm creating this inline example:
Alias: $identUse = http://hl7.org/fhir/R4/codesystem-identifier-use.html
Alias: $cpstatus = https://hl7.org/fhir/codesystem-request-status.html
Alias: $cpintent = https://hl7.org/fhir/codesystem-request-intent.html
Alias: $rgPriority = https://hl7.org/fhir/codesystem-request-priority.html
Alias: $docArtType = https://hl7.org/fhir/codesystem-related-artifact-type.html
Instance: SomeRequestGroup1
InstanceOf: SomeRequestGroup
Title: "A RequestGroup"
Description: "A RequestGroup"
Usage: #inline
- identifier.use = $identUse#secondary
- identifier.system = "https://example.someurl.com/businessidforhelp"
- identifier.value = "a2172f9b-e292-44e0-a2a6-8601fd529ad2"
- instantiatesUri = "https://someurl.com/Guidance.html"
- status = $cpstatus#active
- intent = $cpintent#plan
- priority = $rgPriority#routine
- action.title = "Alfredo17 Buckridge80 (Targeted) recommended for help"
- action.description = "Enroll Alfredo17 Buckridge80 who is currently targeted, into help"
- action.resource = Reference(Communication/MemberStatusTargeted-Communication1)
- action.documentation.type = $docArtType#documentation
- action.documentation.url = "https://someurl.com/helpthepatient"
- action.documentation.label = "Guidance Reference"
which is used in this CarePlan:
Instance: CarePlan-Enrollment
InstanceOf: CarePlan
Title: "Enrollment CarePlan"
Description: "A CarePlan conforming to the CompanyCarePlan profile."
Usage: #example
- identifier.use = $identUse#secondary
- identifier.system = "https://example.someurl.com/businessidforhelp"
- identifier.value = "a2172f9b-e292-44e0-a2a6-8601fd529ad2"
- title = "Recommendations forAlfredo17 Buckridge80"
- description = "Recommendations for Alfredo17 Buckridge80 regarding maintenance of their condition"
- contained[0] = RequestGroup1
- text.status = $narrativeStatus#generated
- text.div = "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n<p>A example CarePlan for a patient.</p>\n"
- status = $cpstatus#active
- intent = $cpintent#plan
- subject = Reference(Patient/T2D-Patient)
- activity[0].reference = Reference(RequestGroup/SomeRequestGroup1)
- activity[+].outcomeReference = Reference(Communication/MemberStatusTargeted-Communication1)
Everything builds, but I get a broken link showing up in my qa.txt.
ERROR: output/toc.html#/html/body/div/div/div/div/div/div/table/tbody/tr/td/a at Line 141, column 16586: The link 'RequestGroup-CarePlan-Enrollment_SomeRequestGroup1.html' for "7.15.1 RequestGroup" cannot be resolved.
Is there a configuration setting that I should be using to tell the TOC generator not to generate links for inline examples? Or am I doing something else wrong? Thanks for any insights.
Mint Thompson (Mar 16 2022 at 13:54):
Hmm, SUSHI shouldn't be trying to list inline instances in the generated ImplementationGuide's list of defined resources, so if that instance isn't appearing in there, I don't know if it's something that's under SUSHI's control.
Catherine Hosage Norman (Mar 16 2022 at 15:45):
Jean Duteau wrote the http://hl7.org/fhir/StructureDefinition/medication-manufacturingBatch extension for the PQ/CMC project.
Chris Moesel (Mar 16 2022 at 15:48):
@Catherine Hosage Norman -- I think you replied to the wrong thread.
Catherine Hosage Norman (Mar 16 2022 at 15:50):
Sorry, only had one cup of coffee so far.
Chris Moesel (Mar 16 2022 at 16:07):
@Matt Jenks - I do see one issue in your FSH. You contain RequestGroup1
:
* contained[0] = RequestGroup1
but then you reference SomeRequestGroup1
(which is a different instance):
activity[0].reference = Reference(RequestGroup/SomeRequestGroup1)
That said, even after fixing this, the IG Publisher is still reporting this broken link error. That seems to be an issue w/ the IG Publisher (not SUSHI). I think it might be a known issue, as it sounds familiar.
Elliot Silver (Mar 16 2022 at 16:47):
(nvm)
Chris Moesel (Mar 16 2022 at 17:21):
@Lloyd McKenzie - are there known issues w/ the IG Publisher / templating system putting links to contained resources in the TOC (but the links are wrong)? E.g., in the following TOC, 2.1.1 RequestGroup
is a broken link to a contained resource.
image.png
Jean Duteau (Mar 16 2022 at 17:27):
I have a guide (http://build.fhir.org/ig/HL7/fhir-spl/branches/main/toc.html) that has contained resources and the resource links have a wrong name but the actual links aren't broken.
Screen-Shot-2022-03-16-at-11.26.47-AM.png
Chris Moesel (Mar 16 2022 at 17:40):
@Jean Duteau -- are those contained resources defined inline only or do they also exist as standalone resources?
Jean Duteau (Mar 16 2022 at 17:40):
ah yes, there's the rub - they exist as standalone.
Jean Duteau (Mar 16 2022 at 17:40):
and here I was trying to help...
Chris Moesel (Mar 16 2022 at 17:42):
Well... that may be a helpful clue...
Lloyd McKenzie (Mar 16 2022 at 18:21):
How can a resource be contained and also stand-alone? Each instance must either be one or the other...
Chris Moesel (Mar 16 2022 at 19:20):
I think he means that in his IG, he has an example OrganizationAffiliation
w/ a specific id (as a standalone resource). In the same IG, his ExampleEstablishment
example has a contained
resource that is the same as his OrganizationAffiliation
example (even w/ the same id).
So, I think his works because:
- the standalone
OrganizationAffiliation
example is what causes the publisher to create an HTML page for it - the contained
OrganizationAffiliation
gets a link in the TOC, and since the contained resource has the same type and id, that link happens to point to the HTML that was produced for the standalone example.
If there was no standalone example w/ the same type and id, then no HTML page would be produced for it, and the link for the contained resource would be broken.
At least that is my hypothesis.
Last updated: Apr 12 2022 at 19:14 UTC