Stream: implementers
Topic: Logical reference to product code
Jose Costa Teixeira (Jan 06 2022 at 17:22):
Conceptually, does it make sense to use a logical reference to a medication code?
I have an element that is a Reference(Medication) and In R4, we don't have CodeableReference.
Jose Costa Teixeira (Jan 06 2022 at 17:22):
Does it make any sense to use a logical reference to the product code (because it's a code, and presumably the code would correspond to a Medication/MedicationKnowledge instance which could have an identifier)?
Jose Costa Teixeira (Jan 06 2022 at 17:22):
(perhaps this is a compliance question - I think I'm really asking if this is a stretch of the intent behind logical references)
Jean Duteau (Jan 06 2022 at 18:34):
i'm not sure what you mean by a "logical reference". In almost all places in R4 where there is a Reference(Medication), it's a choice between that reference and a CodeableConcept. If all you have is a code, then you put it in the CodeableConcept.
Jose Costa Teixeira (Jan 06 2022 at 20:05):
http://www.hl7.org/fhir/references.html#logical
Jose Costa Teixeira (Jan 06 2022 at 20:06):
I'm checking if it is conceptually sensible to use a code in a logical reference.
Jose Costa Teixeira (Jan 06 2022 at 20:06):
Context:
Jose Costa Teixeira (Jan 06 2022 at 20:07):
I have an element (in an extension) that is a reference. Not a codeableconcept, just a reference.
Jose Costa Teixeira (Jan 06 2022 at 20:10):
I see 3 ways to add a code there:
- use a logical reference, simply stick the code as an identifier for the reference, even if the reference doesn't resolve. Simple, available, but may be stretching the mechanism too far - because it implies that the code can be considered an identifier - which I think it can, in the sense of "Medicinal Product Identifier".
Jose Costa Teixeira (Jan 06 2022 at 20:12):
- I make that extension a complex one and use Reference / CodeableConcept. Not really my preferred option because it's a complex extension
Jose Costa Teixeira (Jan 06 2022 at 20:14):
- I can use a reference to a contained resource, and I use a contained resource just to use the product code. I don't like this because I'm just using a contained resource for one element, and also I'll eventually need to search on those product codes.
Lloyd McKenzie (Jan 06 2022 at 21:00):
Why can't you have an extension that accepts a choice of Reference|CodeableConcept?
Jean Duteau (Jan 06 2022 at 21:06):
so you have an extension that you don't control that just has a Reference(Medication)? Then either #2 or #3 is the answer. If you do control the extension, then you should either change it to be a choice of Reference|CodeableConcept or add a CodeableConcept element.
Jose Costa Teixeira (Jan 06 2022 at 21:12):
Lloyd McKenzie said:
Why can't you have an extension that accepts a choice of Reference|CodeableConcept?
My bad, i didn't see that one. A complex extension is not pretty but i can change the data type of the extension
Jose Costa Teixeira (Jan 06 2022 at 21:12):
@Jean Duteau yes, I can change the extension
Jose Costa Teixeira (Jan 06 2022 at 21:13):
so, from this it seems that we don't like option 1... right?
Jean Duteau (Jan 06 2022 at 21:13):
in my opinion, option 1 isn't a option because a code isn't an identifier
Jose Costa Teixeira (Jan 06 2022 at 21:14):
Right. That is the question I wanted to ask.
Jean Duteau (Jan 06 2022 at 21:14):
sorry, i didn't get that from your first post otherwise I'd have just said that. :)
Jose Costa Teixeira (Jan 06 2022 at 21:14):
in Device, an identifier can be a GTIN (i.e. a code). In MedicinalProduct, I think the identifier is a code. Not sure about other resources.
Jose Costa Teixeira (Jan 06 2022 at 21:18):
@Jean Duteau does this relate to the discussion started in MnM last time we spoke? I took a note of the 3 issues I'd need to submit, but while I don't find where I put that note, I'm not sure if this seems related to that.
Jean Duteau (Jan 06 2022 at 21:19):
i don't think so. the conversation revolves around serial numbers and other unique identifiers of resources. in regards to a medication, a code is not an identifier of a specific Medication so I don't see how it would relate.
Jose Costa Teixeira (Jan 06 2022 at 21:20):
right. since Medication sees identifier as the identifier of an instance - this would not apply. That is consistent.
Jose Costa Teixeira (Jan 06 2022 at 21:21):
I wonder if for Device the same would apply, because for Device the Identifier is the Identifier for the product kind, not for the product instance
Jose Costa Teixeira (Jan 07 2022 at 07:23):
so, summary so far
If we have an extension that is a Reference and we want to put a code there, we can
-
Use a logical reference, simply stick the code as an identifier for the reference, even if the reference doesn't resolve. Simple, available, but seems to be stretching the mechanism too far - because it woulc imply that the code can be considered an identifier - which seems to be not kosher
-
Make that extension a complex one and use Reference / CodeableConcept. Not really my preferred option because it's a complex extension
-
Use a reference to a contained resource, and I use a contained resource just to use the product code. I don't like this because I'm just using a contained resource for one element, and also I'll eventually need to search on those product codes.
-
Similar to 2, but instead of a complex extension, simply change the extension from
value[x] only Reference
to `value[x] only Reference or CodeableConcept
Jose Costa Teixeira (Jan 07 2022 at 07:23):
@Brecht Van Vooren FYI . bold is what I would prefer
Rik Smithies (Jan 07 2022 at 10:53):
Re 3 bear in mind that according to the specification contained can be searched. It's just that current off the shelf implementations may or may not have this functionality.
Jose Costa Teixeira (Jan 07 2022 at 20:03):
Right. See above
Jose Costa Teixeira (Jan 07 2022 at 20:03):
It's hardly implemented
Rik Smithies (Jan 07 2022 at 22:38):
But it would be very easy to add support for searching on one or two contained attributes.
Jean Duteau (Jan 08 2022 at 03:52):
I’m not sure why you think it is hardly implemented. We implemented an organization-based system that used contained resources for related orgs and services and we are able to search on them.
Jose Costa Teixeira (Jan 08 2022 at 08:25):
https://chat.fhir.org/#narrow/stream/179166-implementers/topic/Are.20contained.20resources.20evil.3F
Jose Costa Teixeira (Jan 08 2022 at 08:29):
I wouldn't use a contained resource for this except in demonstrating some examples. In real life these resources (not the data) need to be profiled, searched, maintained.
Jose Costa Teixeira (Jan 08 2022 at 08:36):
using option 3 would be the equivalent to going to all the medicationDispense/Request/Administration and replace medication[x] with medicationReference (i.e. just remove the CodeableConcept), and tell people that to use a code, they'd have to contain a resource.
Jose Costa Teixeira (Jan 08 2022 at 08:37):
@Brecht Van Vooren option 4 is what is done by all the resources that we're using, and I will propose the change.
Last updated: Apr 12 2022 at 19:14 UTC