FHIR Chat · extension on choice data type · implementers

Stream: implementers

Topic: extension on choice data type


view this post on Zulip Yunwei Wang (Jun 22 2021 at 19:01):

How do I add extension to an element having choice data type. For example: how do I add DAR extension to Condition.onset (in JSON)?

view this post on Zulip Eric Haas (Jun 23 2021 at 04:48):

{
  "resourceType": "Condition",
  "id": "example",
  "meta": {
    "profile": [
      "http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition"
    ]
  },
  "clinicalStatus": {
    "coding": [
      {
        "system": "http://terminology.hl7.org/CodeSystem/condition-clinical",
        "code": "active",
        "display": "Active"
      }
    ],
    "text": "Active"
  },
  "verificationStatus": {
    "coding": [
      {
        "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status",
        "code": "confirmed",
        "display": "Confirmed"
      }
    ],
    "text": "Confirmed"
  },
  "category": [
    {
      "coding": [
        {
          "system": "http://terminology.hl7.org/CodeSystem/condition-category",
          "code": "problem-list-item",
          "display": "Problem List Item"
        }
      ],
      "text": "Problem"
    }
  ],
  "code": {
    "text": "Single liveborn, born in hospital"
  },
  "subject": {
    "display": "Amy V. Shaw"
  },
  "_onsetDateTime": {
    "extension": [
      {
        "url": "http://hl7.org/fhir/StructureDefinition/data-absent-reason",
        "valueCode": "unknown"
      }
    ]
  }
}

view this post on Zulip Eric Haas (Jun 23 2021 at 04:51):

JSON representation of primitive elements

view this post on Zulip Yunwei Wang (Jun 23 2021 at 14:28):

@Eric Haas But the interpretation of this is "I don't know the onsetDateTime". How do I say "I don't know any of the onset, no matter it is onsetDatetime, or onsetPeriod, or onsetAge". Do I need to list all the choices like

  "_onsetDateTime": {
    "extension": [
      {
        "url": "http://hl7.org/fhir/StructureDefinition/data-absent-reason",
        "valueCode": "unknown"
      }
    ]
  },
  "_onsetAge": {
    "extension": [
      {
        "url": "http://hl7.org/fhir/StructureDefinition/data-absent-reason",
        "valueCode": "unknown"
      }
    ]
  }
...

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

good question, but note that if you knew the time and the Age you would only report one.

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

and no you would not list them as above since max=1

view this post on Zulip Eric Haas (Jun 23 2021 at 15:01):

what you are really asking for is:

"_onset[x]": {
"extension": [
{
"url": "http://hl7.org/fhir/StructureDefinition/data-absent-reason",
"valueCode": "unknown"
}
]
},

which I think would be really confusing for implementers since onset[x] doesn't exist over the wire

view this post on Zulip Eric Haas (Jun 23 2021 at 15:04):

so if the element is min=0 it is omitted. I assume what you are asking is if the min=1

view this post on Zulip Yunwei Wang (Jun 24 2021 at 13:43):

Yes. I agree that using _onset[x] is confusing. So I think the current consensus is that I can pick any one of the choice and add DAR there.

view this post on Zulip Eric Haas (Jun 24 2021 at 15:56):

do you think we should document that.

view this post on Zulip Yunwei Wang (Jun 25 2021 at 14:42):

I think we should document at least in DAR extension. I don't know if other extension could have similar confusion.

view this post on Zulip Lloyd McKenzie (Jun 25 2021 at 16:03):

You have to pick a type. You can't say "I don't know independent of type" because every instance must have a specific type.

view this post on Zulip Yunwei Wang (Jun 25 2021 at 17:06):

In US Core, the US Core DiagnosticReport Lab profile has a mandatory sliced element DiagnosticReport.effective image.png. So if I want to use DAR on that element, I have to pick one of the concrete type, either effectiveDateTime or effectivePeriod, to apply DAR extension. Is my understanding correct?

view this post on Zulip Lloyd McKenzie (Jun 25 2021 at 21:06):

Correct


Last updated: Apr 12 2022 at 19:14 UTC