Skip to content

Reading extensions #2511

Closed Answered by mbaltus
testlorenzospa asked this question in Q&A
Jun 26, 2023 · 3 comments · 1 reply
Discussion options

You must be logged in to vote

With GetExtension you get the whole Extension object. Since you know that this extension's value will have an Address as datatype, you can cast the Extension.Value to its actual Address type and then use that.
Or, if you are only interested in the value anyway, you can use the GetExtensionValue method to get just the Address part:

Address birthPlace = pat_entry.GetExtensionValue<Address>("http://hl7.org/fhir/StructureDefinition/patient-birthPlace");

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@mbaltus
Comment options

Answer selected by mbaltus
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants