FHIR Chat · Address.Country.Extension · implementers

Stream: implementers

Topic: Address.Country.Extension


view this post on Zulip Yuri Bonanno (Jan 02 2019 at 14:50):

          <country value="NLD">
            <extension url="http://nictiz.nl/fhir/StructureDefinition/code-specification">
              <valueCodeableConcept>
                <coding>
                  <system value="urn:oid:2.16.840.1.113883.2.4.4.16.34"/>
                  <code value="6030"/>
                  <display value="Nederland"/>
                </coding>
              </valueCodeableConcept>
            </extension>
          </country>

I have been trying for some time now and I still don't have a way to retrieve the CodeableConcept from the country.extension using HAPI.
Nl-core-address -> details says Address.country.extension is an extension of type CodeableConcept, but I do not know how to use this information effectively.

I've tried casting the types using the following:

CodeableConcept test =   (CodeableConcept) patientResource.getAddress().get(0).getCountryElement().getExtensionFirstRep()

Sadly, this dit not work.

Furthermore, I've looked into

CodeableConcept test = patientResource.getAddress().get(0).getCountryElement().getExtensionFirstRep().castToCodeableConcept(someBase).

but I do not understand what this Base should be, or what its function exactly is.

It would be very much appreciated if someone could help me on this, I have been stuck on this problem for longer than I am willing to admit.

PS: Best wishes for the new year everybody! :)

view this post on Zulip Lloyd McKenzie (Jan 02 2019 at 17:51):

The extension has a type of "Extension". The Extension data type has a polymorphic "value" element. The 'value' is where you'll find your data. (And best wishes to you as well :))

view this post on Zulip Yuri Bonanno (Jan 03 2019 at 07:59):

The extension has a type of "Extension". The Extension data type has a polymorphic "value" element. The 'value' is where you'll find your data. (And best wishes to you as well :))

It works! Thank you!


Last updated: Apr 12 2022 at 19:14 UTC