FHIR Chat · Logical Reference reference to MedicationKnowledge · implementers

Stream: implementers

Topic: Logical Reference reference to MedicationKnowledge


view this post on Zulip Kate Dech (Jun 21 2021 at 18:12):

The MedicationKnowledge resource does not contain an identifier element. Rather it uses code - a CodeableConcept to any number of Medication systems (rxnorm, ndc, etc.) We want to use a logical reference to MedicationKnowledge. Can this use the MedicationKnowledge.code or must it use an Identifier element? Thanks.

view this post on Zulip Yunwei Wang (Jun 21 2021 at 18:14):

identifier is added in R5 http://build.fhir.org/medicationknowledge

view this post on Zulip Kate Dech (Jun 21 2021 at 18:30):

Thank you. I'm not sure if there are other resources like this that don't have identifier but have code instead. In such cases is using a logical reference to the code element not allowed? Must reference.identifier link to the identifier element of the target resource and if there isn't one the reference can't be used?

view this post on Zulip Grahame Grieve (Jun 21 2021 at 19:32):

I think the answer is found here: http://hl7.org/fhir/codesystem.html#implicit

but that's not directly related to the question. But every medication knowledge resource is like a medication resource

view this post on Zulip Rik Smithies (Jun 21 2021 at 23:21):

hi @Kate Dech (copying @Jean Duteau) can I ask what the use case for a logical reference is here? Normally a logical reference is used for FHIR to reference a non-FHIR entity - something that has an identifier, but not a FHIR id. The MedicationKnowledge instance you are referring to has to be FHIR, so it must have an id (unless it's not REST, or not accessible for some reason), so why is it necessary to use a logical reference?

view this post on Zulip Merlyn Albery-Speyer (Jun 22 2021 at 17:45):

I had what I think sounds like the same need. In my case it was to keep the create/update automation unified (everything else you can detect if it's already present by querying for an identifier). I worked around it by querying for all MedicationKnowledge resources and building an in memory cache using my own composite "key" (as code does not uniquely identify one).

view this post on Zulip Jose Costa Teixeira (Jun 22 2021 at 20:37):

Logical references are also for FHIR entities. If you know the ID but you don't have the resource accessible, I think it's expectable to use a Logical Ref.
For this case, I do not see the difference between code and identifier for a medknowledge. Is there one?

view this post on Zulip Rik Smithies (Jun 22 2021 at 21:04):

But if the resource is not accessible, how does the identifier help you?

view this post on Zulip Rik Smithies (Jun 22 2021 at 21:19):

Re code vs identifier - the knowledge is about a medication. The code matches the medication that the knowledge is about. It could be thought of as "subject code".

The indentifier is an identifier of the knowledge itself, of the data. But how often that has any meaning I don't know. This information set, as a whole entity, may have no life outside of FHIR, so it may only have a id. That is not to say that it isn't important information.

view this post on Zulip Jose Costa Teixeira (Jun 23 2021 at 00:05):

My reply was to the statement that logical references being for non-fhir entities. You can have logical references to fhir entities.

view this post on Zulip Rik Smithies (Jun 23 2021 at 09:04):

Thanks for the clarification Jose. My question is why is it ever necessary or desirable to have a logical reference to an accessible FHIR REST entity? I'm sure it is legal I just haven't understood the need. If it's accessible by FHIR then a normal reference seems better. (If we have 2 ways to reference then we need to be able to say why and have some best practice.) If it's in FHIR but never accessible by FHIR REST then I guess there may be some non-FHIR based access possible using identifier - but I wouldn't call that FHIR REST.

view this post on Zulip Eric Haas (Jun 23 2021 at 14:02):

you can profile them out

view this post on Zulip Jose Costa Teixeira (Jun 23 2021 at 15:10):

Our patients are referenced by a logical reference by their national ID number. They may exist as FHIR resources inside our server, but we don't access them use the resource IDs.

view this post on Zulip Rik Smithies (Jun 23 2021 at 15:22):

thanks Jose, that is interesting. What is the rationale for that please? Is it that they may sometimes not exist as accessible FHIR resources? Or is it that actual FHIR ids are not seen as permanent enough? What entity is it that has this FHIR logical reference to them, if I may ask?

view this post on Zulip Kate Dech (Jun 23 2021 at 15:27):

Apologies for the delay. In our case it was a matter of not having the resource available (yet) as an endpoint by id. But there is still value in communicating that there is a relationship to this other entity (and we know there is; even if we haven't built the mechanism to get there directly).

view this post on Zulip Rik Smithies (Jun 23 2021 at 15:33):

hi Kate yes that makes perfect sense. If there is no RESTful resource to link to then you need something else. You could use the identifier (presumably one that has no real world significance?). Can I ask what type of entity it is that is wanting to link to the MedicationKnowledge? Do both ends of the "link" know the code of the medication in question?

view this post on Zulip Jose Costa Teixeira (Jun 23 2021 at 15:44):

Yes, in some cases, they don't exist. We create an allergy for a patient, but in some cases the patient does not yet exist when the first allergy is created.
Sometimes the patient exists, but in another server.
Sometimes there will be several resources in several servers about the same patient. If we have 2 hospitals, each of these hospitals will have one resource representing the patient.
Or by policy we just don't want to use the internal server IDs (because of some reason that I don't recall)

view this post on Zulip Jose Costa Teixeira (Jan 06 2022 at 17:11):

(deleted)

view this post on Zulip Jose Costa Teixeira (Jan 06 2022 at 17:12):

(deleted)

view this post on Zulip Jose Costa Teixeira (Jan 06 2022 at 17:13):

(deleted)

view this post on Zulip Jose Costa Teixeira (Jan 06 2022 at 17:19):

(deleted)


Last updated: Apr 12 2022 at 19:14 UTC