FHIR Chat · Add a core/spec structure definition, like Patient, to an IG · implementers

Stream: implementers

Topic: Add a core/spec structure definition, like Patient, to an IG


view this post on Zulip Shahim Essaid (Nov 10 2020 at 21:37):

I'd like to have resource pages in the IG even if the IG doesn't profile them. I'm thinking it's a good way to communicate the resources in scope for the IG. I'll also be adding IG specific *-intro page content to explain how these resources should be used by the community. It's just a documentation and communication need. Is there way to do this without having to copy the StructureDefinition files? I tried a couple of different references in the ImplementationGuide but it didn't work.

It works if I copy the base profiles and reference them the usual way. There is an exception thrown during the build but the site looks fine, and I don't need schematrons:

Exception generating resource C:\Users\essaids\git\gh\phenopackets\core-ig\ig-root\input\resources\structuredefinition-Patient::StructureDefinition/Patient: not the right kind of structure to generate schematrons for (00:30.0227)
org.hl7.fhir.exceptions.DefinitionException: not the right kind of structure to generate schematrons for
at org.hl7.fhir.r5.conformance.ProfileUtilities.generateSchematrons(ProfileUtilities.java:5278)
at org.hl7.fhir.igtools.publisher.Publisher.generateOutputsStructureDefinition(Publisher.java:7709)
...

view this post on Zulip Eric Haas (Nov 10 2020 at 21:39):

I'd like to have resource pages in the IG even if the IG doesn't profile them.

I typically just reference the source that did profile them.

view this post on Zulip Shahim Essaid (Nov 10 2020 at 21:40):

A related question, if I need to declare the base spec as a dependency in the ImplementationGuide for this to work, how do I do that? I'm not sure the base spec is really an IG and I couldn't find the right URL for it. Also, I'm assuming there is no need to declare that dependency since it's always there.

view this post on Zulip Shahim Essaid (Nov 10 2020 at 21:41):

@Eric Haas I need to point to http://hl7.org/fhir/StructureDefinition/Patient, the base profile. I tried a full URL but it didn't work

view this post on Zulip Shahim Essaid (Nov 10 2020 at 21:46):

<definition>
<resource>
<reference>
<reference value="http://hl7.org/fhir/StructureDefinition/Patient" />
</reference>
</resource>

java.lang.Exception: Bad Resource Identity - should have the format [Type]/[id] where Type is a valid resource type:http://hl7.org/fhir/StructureDefinition/Patient ....

<definition>
<resource>
<reference>
<reference value="StructureDefinition/Patient" />
</reference>
</resource>

java.lang.Exception: Unable to find the source file for StructureDefinition/Patient: not specified, ...

But the second option above works if I copy the base profile to my IG. I'm assuming there is a way to do this without having to copy it.

view this post on Zulip Lloyd McKenzie (Nov 10 2020 at 22:04):

The base spec is automatically a dependency. When you declare your FHIRVersion, that sets the dependency

view this post on Zulip Lloyd McKenzie (Nov 10 2020 at 22:05):

In general, rather than including the resource, I'd just include some documentation about it and include a link to the rendering in the core spec. That way if there's a technical correction, people reading your IG will still see the authoritative source.

view this post on Zulip Shahim Essaid (Nov 10 2020 at 22:35):

That works for my short term needs but I'd imagine that it might be useful to add those resources to the actual ImplementationGuide instance so they become visible to any custom tools doing any sort of processing of the IG's content (given that the IG instance is the entry point for tooling). The IG's static site can be rebuilt to pull in any updates from the base spec as long as I only reference the base profiles, not copy them.

Does this mean that with the current publisher tooling there is no way to add a remote reference to a base profile like Patient as a resource in my ImplementatinGuide instance?

view this post on Zulip Eric Haas (Nov 10 2020 at 23:45):

I have reference to the base fhir spec all my guides as do other authors. you can provide a direct link or use the url . It is unclear why your readers can't or won't follow the links to the authoritative source.

For example here is a page with a link to the patient resource....

image.png

image.png

The ig publisher also generate a link to the profile dependency as well...

view this post on Zulip Shahim Essaid (Nov 10 2020 at 23:51):

@Eric Haas I don't think you're following my specific use case. I want to point to a specific FHIR profile to be included in my ImplementationGuide. I want Patient to be in my IG, not my own profile of Patient. I want the same StructureDefinition that is released with R4 for Patient to be added to my IG. I'm not profiling it! I know that if I create a profile the tools will add a link to the base profile of my profile but in this case I don't have a profile, I just want Patient to appear in my IG as it is in R4. Have you seen an example of that? Also, I understand that I can add a page to my IG as @Lloyd McKenzie suggested, and that is useful for readers, but it is not accessible to tooling loading my ImplementationGuide instance and all the resources referenced from it.

For now I'm copying these StructureDefinitions and adding them to my IG. This is just for internal use so far so it's more about documenting/asserting (for readers and tooling) that those resources, as is, are part of our IG. We can clean this up later if there is a better solution that works for human readers and tools.

view this post on Zulip Michele Mottini (Nov 11 2020 at 00:05):

I want Patient to be in my IG, not my own profile of Patient.

A completely empty Patient would then be ok according to your implementation guide - is that really what you want?

view this post on Zulip Lloyd McKenzie (Nov 11 2020 at 00:07):

The IG tooling isn't designed to include a resource. Resources are expected to only publish in the core specification. If you try to copy the structure definition for a resource into an IG, it's possible they'll publish correctly, but it's entirely possible the publisher won't work - and it's unlikely we'd fix the issue. Our intention is for there to be a single source of truth for the resources - and that's the core spec. Even if you were to get the resources in your IG, all the references between them would resolve to the core spec, not the equivalent location in your IG. Similarly, all the data types would resolve to the core spec. There's no ability to publish an IG that doesn't include an expectation for online access to the core spec. At least not with HL7-designed tools.

view this post on Zulip Lin Zhang (Nov 11 2020 at 00:13):

(deleted)

view this post on Zulip Shahim Essaid (Nov 11 2020 at 00:14):

@Lloyd McKenzie thanks for the clarifications. I also don't want to copy, and would want all references to point to the base spec, the tooling needing online access, etc. I'm just trying to find a way to clearly capture (for readers and any custom tooling) that the base resource is part of the overall model being defined in my IG.

view this post on Zulip ryan moehrke (Nov 11 2020 at 00:14):

I'm not sure this covers your usecase either, but an option for when you want to declare a resource important and necessary but don't want to re-profile it at all is to just have a CapabilityStatement page calling out the base fhir resource as SHALL support etc. The narrative then can also have a link out to the resource in the base fhir spec so that any readers can follow those links and inspect the resource definitions themselves.

view this post on Zulip Lloyd McKenzie (Nov 11 2020 at 00:17):

@Lin Zhang, I'm not sure what you're looking for
@Shahim Essaid all IGs I've seen to date accomplish that objective with hyperlinks

view this post on Zulip Shahim Essaid (Nov 11 2020 at 00:20):

@Lloyd McKenzie hyperlinks work for readers but I'm also thinking about later custom tooling. Tools need to find that info in the conformance resources of my IG, not in the pages. @ryan moehrke suggestion is a good option to formally capture that. I was thinking about trying to do it in ImplementationGuide so far but the CapabilityStatement is another good option. I haven't worked with CS yet so I'll be looking into that soon.

Thanks everyone for all the help and suggestions. Much appreciated!

view this post on Zulip Lin Zhang (Nov 11 2020 at 00:23):

(deleted)

view this post on Zulip ryan moehrke (Nov 11 2020 at 00:26):

note of clarification: you can include a capability statement inside of an implementation guide and this is what I was suggesting (i.e. https://build.fhir.org/ig/HL7/davinci-pdex-plan-net/CapabilityStatement-plan-net.html), but if a standalone capabilitystatement can represent all the info you need then it may be a fine option too.

view this post on Zulip Lin Zhang (Nov 11 2020 at 00:33):

(deleted)

view this post on Zulip Grahame Grieve (Nov 12 2020 at 10:16):

@Shahim Essaid I don't understand what your concern is with the tools. The tools will see the IG through the NPM ecosystem, which will identify your IGs NPM dependencies, and those dependencies have to be resolved. So anything in the core will automatically be available to the tools


Last updated: Apr 12 2022 at 19:14 UTC