FHIR Chat · Erroneous Patient extension? · implementers

Stream: implementers

Topic: Erroneous Patient extension?


view this post on Zulip Brendan Keeler (Sep 27 2021 at 15:27):

patient-preferenceType is listed as part of Patient.communication.preferred, which is weird since that's a boolean. Should this be similar to patient-proficiency, in that it's part of the Patient.communication?

view this post on Zulip Brendan Keeler (Sep 27 2021 at 15:27):

image.png

view this post on Zulip Brendan Keeler (Oct 01 2021 at 15:18):

Anyone have ideas here?

view this post on Zulip Simone Heckmann (Oct 01 2021 at 15:37):

I think the idea it that you add the extension on Patient.communication.preferred in order to qualify whether the preference relates to written or verbal communication.

So in effect you could have two Patient.communication nodes both with preferred = true, but one qualified as verbal preference and one as written preference.

view this post on Zulip Piotr Sokoliński (Oct 18 2021 at 08:07):

@Simone Heckmann I am not sure that I understand. Communication is a BackboneElement so it has an extension field and therefore patient-proficiency should be placed in Patient.Communication (as documentation on Brendan's screenshot says).

...restOfThePatient,
communication: [
    {
      extension: [
        {
          extension: [
            {
              url: "level",
              valueCoding: {
                system: "urn:oid:2.16.840.1.113883.5.61",
                code: "G",
                display: "Good",
              },
            },
            {
              url: "type",
              valueCoding: {
                system: "urn:oid:2.16.840.1.113883.5.60",
                code: "ESP",
                display: "Expressed spoken",
              },
            },
          ],
          url: "http://hl7.org/fhir/StructureDefinition/patient-proficiency",
        },
      ],
      language: {
        coding: [
          {
            system: "http://tools.ietf.org/html/bcp47",
            code: "ita",
          },
        ],
      },
      preferred: false,
    }
],
...restOfThePatient

But when it comes to the patient-preferenceType the documentation states that it should be in Patient.Communication.preffered, which is a boolean type, so it is not extensible, it does not have an extension field. I have an Extension that looks like that:

{
          valueCoding: {
            code: "verbal",
            display: "verbal",
            system: "http://hl7.org/fhir/language-preference-type",
          },
          url: "http://hl7.org/fhir/StructureDefinition/patient-preferenceType"
}

but I have no idea where to put it to satisfy the FHIR validator, when I put it in Patient.Communication I get "Patient.communication[0]: The extension http://hl7.org/fhir/StructureDefinition/patient-preferenceType is not allowed to be used at this point (allowed = e:Patient.communication.preferred; this element is [[Patient.communication, BackboneElement]) ". But as I said before preferred is a boolean, so I can not put extension there. Could you help me with this? I would appreciate this. Thank you in advance!

view this post on Zulip Simone Heckmann (Oct 18 2021 at 08:12):

All elements in FHIR are extensible, not just backbone elements

view this post on Zulip Piotr Sokoliński (Oct 18 2021 at 08:16):

So my communication for the Patient should look like this?

...restOfThePatient,
communication: [
    {
      extension: [
        {
          extension: [
            {
              url: "level",
              valueCoding: {
                system: "urn:oid:2.16.840.1.113883.5.61",
                code: "G",
                display: "Good",
              },
            },
            {
              url: "type",
              valueCoding: {
                system: "urn:oid:2.16.840.1.113883.5.60",
                code: "ESP",
                display: "Expressed spoken",
              },
            },
          ],
          url: "http://hl7.org/fhir/StructureDefinition/patient-proficiency",
        },
      ],
      language: {
        coding: [
          {
            system: "http://tools.ietf.org/html/bcp47",
            code: "ita",
          },
        ],
      },
      preferred: {
          valueCoding: {
            code: "verbal",
            display: "verbal",
            system: "http://hl7.org/fhir/language-preference-type",
          },
          url: "http://hl7.org/fhir/StructureDefinition/patient-preferenceType"
     },
    }
],
...restOfThePatient

Unfortunately, when I try to validate such a Patient I get "Patient.communication[0].preferred: This property must be an simple value, not an object (preferred at Patient.communication[0].preferred)" from validator.

view this post on Zulip Lloyd McKenzie (Oct 18 2021 at 14:24):

To extend preferred, you need to say this:

      _preferred: {
          "extension": [{
               valueCoding: {
                      code: "verbal",
                      display: "verbal",
                      system: "http://hl7.org/fhir/language-preference-type",
              },
              url: "http://hl7.org/fhir/StructureDefinition/patient-preferenceType"
           }]
      },

view this post on Zulip Piotr Sokoliński (Oct 18 2021 at 16:33):

Thank you very much! I could not find it in the documentation. It is documented somewhere?

view this post on Zulip Lloyd McKenzie (Oct 18 2021 at 16:38):

Yup :) https://hl7.org/fhir/json.html#primitive

view this post on Zulip Piotr Sokoliński (Oct 18 2021 at 16:43):

Thanks again!


Last updated: Apr 12 2022 at 19:14 UTC