FHIR Chat · Coding · implementers

Stream: implementers

Topic: Coding


view this post on Zulip Ankita Srivastava (Jul 24 2020 at 12:46):

Hi All, Just a quick query for coding datatype.. in case code/system has no value or inappropriate value from the data source because of any reason, then how should we store the corresponding value in our system. I know in case of CodeableConcept, I can use text field but not sure in case of coding. Please suggest. Thank you

view this post on Zulip Lloyd McKenzie (Jul 24 2020 at 12:49):

For a Coding, there's no way to store free text without using an extension. Coding is generally used as a data type where free text would never be relevant/appropriate.

view this post on Zulip Lloyd McKenzie (Jul 24 2020 at 12:49):

(If you find a place where that's not true, please submit a change request.)

view this post on Zulip Ankita Srivastava (Jul 24 2020 at 12:52):

I agree with you.. that is where my confusion is.. if from the data source, i didn't get proper value for system/code then how should I identify the value in my valueset.

view this post on Zulip Lloyd McKenzie (Jul 24 2020 at 13:04):

If you have a value set, you have to have a code + system...

view this post on Zulip Ankita Srivastava (Jul 24 2020 at 13:06):

I have valueset (code+system) defined at my end. But when I receive the data from other system which has not properly sent the code/system values then... do I directly look into my valueset for the proper value or just ignore the value.

view this post on Zulip Ankita Srivastava (Jul 24 2020 at 13:07):

should I search in my own valueset based on the display value received ignoring the code/system value issue

view this post on Zulip Ankita Srivastava (Jul 24 2020 at 13:32):

Other case - if i receive only value.. and system/code is empty from the data source.. do i need to check my valueset defined for that field based on display value received?

view this post on Zulip Lloyd McKenzie (Jul 24 2020 at 14:38):

If you are receiving codes that don't fall in the value set, you'd need to translate the codes. If you can't find translations and the binding is 'required', you can't send the element, though you might be able to send the data as an extension.

view this post on Zulip Ankita Srivastava (Jul 24 2020 at 15:04):

@Lloyd McKenzie By "translate code" do you mean I need to do the translation based on the display value only, if system/code element is empty. I am referring to this scenario while receiving the data from some other system (not while sending it). Here, I am just curious to find the way to store the value in my system.

view this post on Zulip Lloyd McKenzie (Jul 24 2020 at 15:20):

Can you give a concrete example? What Coding element are you considering and what sort of data are you receiving?

view this post on Zulip Ankita Srivastava (Jul 24 2020 at 15:40):

@Lloyd McKenzie I am sorry ... I guess I am unable to explain my query properly.. might be I am misunderstanding something here. So without confusing you.. my simple query is - if I receive system, display value (of coding element) and code is missing then in that case do I need to look into valueset (referred by my system) based on the received display so as to identify the corresponding code.

view this post on Zulip Ankita Srivastava (Jul 24 2020 at 15:53):

For E.g. I have received the encounter.reasoncode.display as Viral sinusitis (disorder) without any system/code defined. What should be my approach to store such type of value in coding/codeableconcept element.

view this post on Zulip Lloyd McKenzie (Jul 24 2020 at 16:21):

In general, it's bad practice to send system and display but not code - so the first thing you should do is phone up the sender and yell at them. :) (What they should do is send the text in CodeableConcept.text.)
However, if the specification doesn't mandate that specific codes must be present, you can relay the data as you received it. If the specification does mandate that the element is restricted to specific codes, then the instance you've received is non-conformant. You can still choose to receive it, but you can't send the data "as is" yourself without being non-conformant. In the case of Encounter.reasonCode, you're free to send the data as received because there's no constraint on what codes must be present.

view this post on Zulip Ankita Srivastava (Jul 24 2020 at 16:26):

In case of encounter.reasoncode, it was feasible to store the value as a text. What if samething happens with encounter.class(coding).. how should I store the data in that case. Apologies for asking so many queries.

view this post on Zulip Ankita Srivastava (Jul 24 2020 at 16:27):

Basically, I am struggling with value storing at my end in case sender is sending data in free text form as we are receiving data from systems which are non compliant to FHIR (sending data in flatfile).. and this is the most likely case with them.. and we need to convert the same in FHIR.

view this post on Zulip Lloyd McKenzie (Jul 24 2020 at 17:24):

I would submit a change request. Encounter.class shouldn't be Coding. There are situations where translations would be relevant.

view this post on Zulip Lloyd McKenzie (Jul 24 2020 at 17:24):

Coding is only appropriate in places like Questionnaire.item.code, where it's saying 'this is a code that goes with this question' and the notion of 'text' would make no sense.

view this post on Zulip Ankita Srivastava (Jul 24 2020 at 17:37):

Ok.. but what should be my approach in current scenario (with coding) in place.. and it’s not only about encounter.class.. there are other elements as well with coding.. so if we have data in free text then how to make it compliant.

view this post on Zulip Lloyd McKenzie (Jul 24 2020 at 17:43):

Well, that's an extensible binding - so if the data from the original source is compliant, you're free to pass it along as-is. If not, you'd have to shove that data into an extension and omit class.

view this post on Zulip Ankita Srivastava (Jul 24 2020 at 17:51):

@Lloyd McKenzie Thank you very much for all the suggestions.. now atleast I have clarity to progress in this situation.. just wanted to check if I can do lookup in valueset based on the display received and then identify code against it.. will that make sense.

view this post on Zulip Lloyd McKenzie (Jul 24 2020 at 18:17):

You can't reliably look up a code based on a display. First, there's no guarantee that displays are unique. Second, systems are allowed to override displays within their internal value set definitions, so the display isn't guaranteed to be one of the official ones from the code system.

view this post on Zulip Lloyd McKenzie (Jul 24 2020 at 18:18):

If it were possible to look up the code from the display, that step really ought to have been done by the sender...

view this post on Zulip Ankita Srivastava (Jul 24 2020 at 23:17):

Thank you @Lloyd McKenzie for the detailed clarification.. it is really helpful.

view this post on Zulip Ankita Srivastava (Jul 24 2020 at 23:58):

I was going through the options in case of improper values received from flatfile, and got a concept of Null Flavor. So, can I use this approach that if I don’t receive proper values then my system should refer to null flavor valueset and store the value accordingly instead of making any assumptions.

view this post on Zulip Lloyd McKenzie (Jul 25 2020 at 01:14):

There's no reason to fill in a dataAbsentReason (null flavor is a CDA concept, not a FHIR one) unless the recipient would have a use for the value. And specifying a dataAbsentReason extension doesn't let you get away from the binding rules. In the Encounter example, it has an extensible binding - that means that if your concept is equivalent to or a specialization of one of the required codes, you must send that code in the instance. So if you're getting a data flat file, you'd have to figure out what the corresponding concepts were for whatever display names you've got and figure out which ones would map to one of the approved concepts.

view this post on Zulip Ankita Srivastava (Jul 25 2020 at 01:19):

Sorry.. are you referring to DataAbsenceReason element which is present in Observation.. If so, I didn't mean that.

view this post on Zulip Ankita Srivastava (Jul 25 2020 at 01:20):

I understood your point.. Thanks for the clarification. :)

view this post on Zulip Ankita Srivastava (Jul 25 2020 at 01:34):

Based on our discussion, I will create a workflow for this situation and will share with you for review.. so that in future, others can also refer to that in similar situations. Thanks a lot @Lloyd McKenzie for resolving my queries.

view this post on Zulip Lloyd McKenzie (Jul 25 2020 at 02:20):

Actually I'm referring to the dataAbsentReason extension - which can appear anywhere.

view this post on Zulip Ankita Srivastava (Jul 25 2020 at 02:21):

I got it and completely agree with you.. Thanks


Last updated: Apr 12 2022 at 19:14 UTC