FHIR Chat · Logical Model instances · IG creation

Stream: IG creation

Topic: Logical Model instances


view this post on Zulip Grahame Grieve (Apr 09 2020 at 21:01):

The underlying validation infrastructure allows for a instances of logical models. That is, define a entirely new logical model, and then, following standard FHIR serialization rules, you can make an instance for that.

view this post on Zulip Grahame Grieve (Apr 09 2020 at 21:01):

now, I have a request to allow you to include those instances in an IG.

view this post on Zulip Grahame Grieve (Apr 09 2020 at 21:02):

The IG publisher doesn't allow you to do this right now.

view this post on Zulip Grahame Grieve (Apr 09 2020 at 21:02):

first issue (no doubt there will be many): ImplementationGuide.definition.resource is for resources, not other things. So how do you include them in an IG?

view this post on Zulip Vassil Peytchev (Apr 09 2020 at 21:12):

This may be a basic question, but what is a Logical Model instance? Something that looks as a Resource instance, but isn't? Or does it refer to the definition, like http://build.fhir.org/request.html ?

view this post on Zulip Jose Costa Teixeira (Apr 09 2020 at 21:20):

For example if a functional analyst defines that one of our examples will be
"Prescription 1, for patient 123, prescribed by Dr. ABC, due to bacterial infection, for drug XYZ, 2 times a day for 7 days.

view this post on Zulip Jose Costa Teixeira (Apr 09 2020 at 21:20):

if we have a logical model of our concept of prescription, the logical model instance would contain the values in bold.

view this post on Zulip Jose Costa Teixeira (Apr 09 2020 at 21:21):

this model will be implemented in FHIR but also in other standards, it helps having an example not in an implemented format.

view this post on Zulip Grahame Grieve (Apr 09 2020 at 21:24):

@Vassil Peytchev here's a logical model: http://hl7.org.au/fhir/rcpa/colorectal.html#table

And there's an instance based on that logical model: http://hl7.org.au/fhir/rcpa/Colorectal-Colorectal-genexample-1.json.html

As a logical model, it it's not a resource that exists and is used with the RESTful api or messages or documents. But it can still exist as a json or xml (or something else; there's logical models for v2)

view this post on Zulip Vassil Peytchev (Apr 09 2020 at 21:44):

Thanks, that helps. The first thing that jumps at me is that the instance starts with "resourceType" : "Colorectal". How does one distinguish between a logical model instance and a resource instance? Or is that not important/necessary?

view this post on Zulip Oliver Egger (Apr 09 2020 at 21:57):

is the colorectal logical model generated by the spreadsheet definition? i'm having a similar feature request as I would like to add CDA documents as an example for the cda logical model, but the id element of CDA makes it further complicated (id is often an uuid, for an ig i would prefer a different name for the example instead of the uuid)

view this post on Zulip Grahame Grieve (Apr 09 2020 at 22:04):

The first thing that jumps at me is that the instance starts with "resourceType" : "Colorectal"

yes that's a good question. I don't think that's actually right - at a minimum it would have to be the full URL for the structure definition, but it could be some some other way. but simply "resourceType" : "Colorectal" is wrong

view this post on Zulip Grahame Grieve (Apr 09 2020 at 22:05):

I would like to add CDA documents as an example for the cda logical model, but the id element of CDA makes it further complicated

the file name doesn't have to match the uuid

view this post on Zulip Michael van der Zel (Apr 10 2020 at 07:07):

I have another point. I could not get the Logical Model to validate unless I specified "Resource" as its base-class. Does that make it a resource? And what did I do wrong here?
StructureDefinition.type is 1..1, the valueset is FHIRDefinedType, but it is Extensible and it is defined as "Either a resource or datatype, including logical model types"? So why does the validator give a fail here?

view this post on Zulip Michael van der Zel (Apr 10 2020 at 07:24):

Ok. The validator doesnot fail.. It is a Warning.

view this post on Zulip Giorgio Cangioli (Apr 10 2020 at 08:27):

This means that you have included an instance of a LM in the IG, defining the LM as a specialization of a Resource and not of an Element ?

view this post on Zulip Michael van der Zel (Apr 10 2020 at 10:40):

Yes. I looked at Element but that is a datatype. That did not feel the right base type for the LM.

view this post on Zulip Jose Costa Teixeira (Apr 10 2020 at 10:46):

(nevermind)

view this post on Zulip Jose Costa Teixeira (Apr 10 2020 at 10:58):

from here
http://build.fhir.org/types.html

view this post on Zulip Jose Costa Teixeira (Apr 10 2020 at 10:59):

I see that Base (...) type is used in Logical Models that don't have or want id/extension.
http://build.fhir.org/types.html#Base
(I read this as I should use Base or Element for LMs?)

view this post on Zulip Jose Costa Teixeira (Apr 10 2020 at 11:01):

also, the 2 links to Logical Models in that page only link to the same page - does this mean we are not supposed to have a Logical Models page in the spec?

view this post on Zulip Michael van der Zel (Apr 17 2020 at 06:52):

@Jose Costa Teixeira I missed that. Thanks.

view this post on Zulip Jose Costa Teixeira (Apr 24 2020 at 21:01):

On Logical Model instances:

view this post on Zulip Jose Costa Teixeira (Apr 24 2020 at 21:04):

Could an instance of a logical model be added to the IG as
a) an instance of a custom resource
b) a StructureDefinition where each elementdefinition only has the elementdefinition.path and the example value?

view this post on Zulip Jose Costa Teixeira (Apr 24 2020 at 21:04):

b) would look strange. I don't know how a) would look like

view this post on Zulip Lloyd McKenzie (Apr 24 2020 at 22:07):

I don't think we want to support custom resources in the publisher?

view this post on Zulip Jose Costa Teixeira (Aug 17 2020 at 07:53):

also, the 2 links to Logical Models in that page only link to the same page - does this mean we are not supposed to have a Logical Models page in the spec?

http://build.fhir.org/types.html point 3. Logical models points to itself. Should we have something about logical models in the core spec? I think so.
I'm happy to contribute with some work

view this post on Zulip Elliot Silver (Aug 17 2020 at 15:16):

Additional information on logical models would be helpful. I'm trying to create one, and finding the documentation, ah, lacking.

view this post on Zulip Jose Costa Teixeira (Nov 20 2020 at 10:37):

Back to this: any idea on what a Logical Model instance would look like?

view this post on Zulip Frank Oemig (Mar 18 2021 at 09:19):

Where can I find an example that works? All my experiments fail

view this post on Zulip Jose Costa Teixeira (Mar 18 2021 at 12:08):

An example of a Logical Model? we have a few.
Or examples of instances? - that we don't have because we don't know what that is "an instance of a LM")

view this post on Zulip Frank Oemig (Mar 22 2021 at 08:08):

Generating LMs work, but instances not. I suppose that depends on the unknown structure. Is there a way to generate arbitrary XML or JSON as is?

view this post on Zulip Jose Costa Teixeira (Mar 22 2021 at 09:36):

I don't know what an instance is: a LM is an abstract definition of a data structure. We haven't landed on what an instance of that is - i presume because one can only instanciate physical specifications, not abstract ones.

view this post on Zulip Jose Costa Teixeira (Mar 22 2021 at 09:39):

We could go around that by "opening an exception" for LMs and allow to create examples as with any other; or stick to using the ElementDefinition.example element in the same definition. Or other...

view this post on Zulip Frank Oemig (Mar 22 2021 at 10:11):

A LM describes a hierarchy of elements. It is only abstract if it is not complete. I do not see why you cannot instantiate one? So we have a LM for CDA, and multiple ones for v2...

view this post on Zulip Lloyd McKenzie (Mar 22 2021 at 13:04):

The logical models for v2 or CDA doesn't have an automated correlation with how the instances are supposed to look. That doesn't mean you couldn't write code that could parse and serialize them, but it doesn't come "out of the box" like FHIR parsing and serialization do.

view this post on Zulip Frank Oemig (Mar 22 2021 at 14:58):

Correct. But here I simply would like to get XML and/or JSON examples shown nicely formatted. Currently it takes me a lot of work to get them integrated into a page, but most probably I am doing something wrong...


Last updated: Apr 12 2022 at 19:14 UTC