HL7 / fhir-ig-publisher

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

use artifact-title and artifact-description extension #790

Open JohnMoehrke opened 11 months ago

JohnMoehrke commented 11 months ago

For artifacts that don't have IG defined title and description; use the extension artifact-title and artifact-description.

In my case I have preprocessing scripts that convert old data into FHIR resources. I can inline artifact-title and artifact-description easily; where as populating the IG is harder.

JohnMoehrke commented 11 months ago

would also be nice if the IG publisher striped these out, as they are just there to inform the IG publisher.

adamzkover commented 11 months ago

Possible that there was an extension like this for the title, that was removed? https://github.com/HL7/fhir-ig-publisher/commit/27cfd47e10585d0b3ceb1a03fe3f80341f6c2612

Healthedata1 commented 11 months ago

there are these already and I strip them out using a bash script and I think Sushi strips them as well.

resourceType: MedicationRequest
id: coded-oral-axid-with-compliance
meta:
  profile:
  - http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest
  extension:
  - url: http://hl7.org/fhir/StructureDefinition/instance-name #<<<<<<<<<<<<<<HERE
    valueString: MedicationRequest Coded Oral Axid with Compliance Extension Example
  - url: http://hl7.org/fhir/StructureDefinition/instance-description #<<<<<<<<<<<<<<<<<<HERE
    valueMarkdown: This example demonstrates medication adherence for a prescribed medication example using an extension on the MedicationRequest. The extension value uses SNOMED CT.
#....
Healthedata1 commented 11 months ago

https://hl7.org/fhir/extensions/StructureDefinition-resource-instance-name.html

https://hl7.org/fhir/extensions/StructureDefinition-resource-instance-description.html

are in the latest extensions pack... not sure what happened to the ones I am currently using, but they work with sushi to load the title and descriptions into the ig resource so you don't have to

lmckenzi commented 11 months ago

We will update the IG publisher to propagate the artifact-title and artifact-description into ImplementationGuide.definition.resource.name/description if they exist (and there aren't core title/description elements). However, unlike resource-instance-name and resource-instance-description, these extensions will not get stripped out of the original resources as part of the publication process. Will ask Sushi to follow this same behavior. The "instance-name" and "instance-description" extensions aren't defined and shouldn't be used.

lmckenzi commented 11 months ago

NOTE: resource-instance-description doesn't seem to be working right now.

adamzkover commented 11 months ago

NOTE: resource-instance-description doesn't seem to be working right now.

Does the same apply to resource-instance-name, or does that work for you?

On this resource:

<?xml version="1.0" encoding="UTF-8"?>
<Patient xmlns="http://hl7.org/fhir">
    <id value="1"/>
    <extension url="http://hl7.org/fhir/StructureDefinition/resource-instance-name">
        <valueString value="Name for patient introduced through extension"/>
    </extension>
    <name>
        <text value="Name As Text"/>
        <family value="FamName"/>
        <given value="GivenName"/>
    </name>
</Patient>

I get the error for it from the IG publisher:

Unable to find ImplementationGuide.definition.resource.name for the resource Patient/1. Name is mandatory if it cannot be inferred from the resource to allow proper population of the artifact list.

JohnMoehrke commented 11 months ago

resource-instance-name did work as expected.

I get an error from the IG Publisher validation

Value is 'http://hl7.org/fhir/StructureDefinition/resource-instance-description' but must be 'http://hl7.org/fhir/StructureDefinition/resource-instance-name'

that led me to looking at the extension.

https://hl7.org/fhir/extensions/StructureDefinition-resource-instance-description.html

The extension definition has a bug in it that the Extension.url / fixedUri is wrong. It is set to the http://hl7.org/fhir/StructureDefinition/resource-instance-name

JohnMoehrke commented 11 months ago

I have added all three pairs of extensions to a test IG https://build.fhir.org/ig/JohnMoehrke/testMed/branches/main/DocumentReference-1234.html

https://github.com/JohnMoehrke/testMed

adamzkover commented 11 months ago

I have added all three pairs of extensions to a test IG https://build.fhir.org/ig/JohnMoehrke/testMed/branches/main/DocumentReference-1234.html

https://github.com/JohnMoehrke/testMed

In this example, SUSHI adds the resource declaration to the ImplementationGuide resource, with name value from the extension. Is that right? So the extension only works if the IG uses SUSHI. Than can explain why the same extension doesn't work for me, since my IG doesn't have FSH.

adamzkover commented 11 months ago

See an example IG here: https://build.fhir.org/ig/adamzkover/testIgNameExtensions/qa.html