question about accessing entry in fhir #73
Unanswered
ninaboord
asked this question in
Office Hours
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Related Discussion
I have a FHIR resource from mock patient data (below) -- I was trying to use Spezi FHIRResource Search to grab data from this FHIR resource (I just want the strings for "date of birth" and "name" -- how do I do this?
I tried making a struct like so,
struct User: Codable {
var name: String
var dob: String
var gender: String
}
and decoding the json into it, but since it's a FHIR resource it's handled differently. Thank you!
Resource is below for reference:
{
"address" : [
{
"city" : "Lawrence",
"country" : "US",
"extension" : [
{
"extension" : [
{
"url" : "latitude",
"valueDecimal" : 42.755478874424206
},
{
"url" : "longitude",
"valueDecimal" : -71.16438824378747
}
],
"url" : "http://hl7.org/fhir/StructureDefinition/geolocation"
}
],
"line" : [
"274 Dooley Avenue"
],
"postalCode" : "01843",
"state" : "MA"
}
],
"birthDate" : "2015-05-03",
"communication" : [
{
"language" : {
"coding" : [
{
"code" : "en-US",
"display" : "English (United States)",
"system" : "urn:ietf:bcp:47"
}
],
"text" : "English (United States)"
}
}
],
"extension" : [
{
"extension" : [
{
"url" : "ombCategory",
"valueCoding" : {
"code" : "2106-3",
"display" : "White",
"system" : "urn:oid:2.16.840.1.113883.6.238"
}
},
{
"url" : "text",
"valueString" : "White"
}
],
"url" : "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race"
},
{
"extension" : [
{
"url" : "ombCategory",
"valueCoding" : {
"code" : "2135-2",
"display" : "Hispanic or Latino",
"system" : "urn:oid:2.16.840.1.113883.6.238"
}
},
{
"url" : "text",
"valueString" : "Hispanic or Latino"
}
],
"url" : "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName",
"valueString" : "Polly738 Lindgren255"
},
{
"url" : "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex",
"valueCode" : "F"
},
{
"url" : "http://hl7.org/fhir/StructureDefinition/patient-birthPlace",
"valueAddress" : {
"city" : "Cambridge",
"country" : "US",
"state" : "Massachusetts"
}
},
{
"url" : "http://synthetichealth.github.io/synthea/disability-adjusted-life-years",
"valueDecimal" : 0.13231128504228493
},
{
"url" : "http://synthetichealth.github.io/synthea/quality-adjusted-life-years",
"valueDecimal" : 6.8676887149577155
}
],
"gender" : "female",
"id" : "5b3645de-a2d0-d016-0839-bab3757c4c58",
"identifier" : [
{
"system" : "https://github.com/synthetichealth/synthea",
"value" : "5b3645de-a2d0-d016-0839-bab3757c4c58"
},
{
"system" : "http://hospital.smarthealthit.org",
"type" : {
"coding" : [
{
"code" : "MR",
"display" : "Medical Record Number",
"system" : "http://terminology.hl7.org/CodeSystem/v2-0203"
}
],
"text" : "Medical Record Number"
},
"value" : "5b3645de-a2d0-d016-0839-bab3757c4c58"
},
{
"system" : "http://hl7.org/fhir/sid/us-ssn",
"type" : {
"coding" : [
{
"code" : "SS",
"display" : "Social Security Number",
"system" : "http://terminology.hl7.org/CodeSystem/v2-0203"
}
],
"text" : "Social Security Number"
},
"value" : "999-52-6108"
}
],
"maritalStatus" : {
"coding" : [
{
"code" : "S",
"display" : "Never Married",
"system" : "http://terminology.hl7.org/CodeSystem/v3-MaritalStatus"
}
],
"text" : "Never Married"
},
"meta" : {
"profile" : [
"http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"
]
},
"multipleBirthBoolean" : false,
"name" : [
{
"family" : "Bogan287",
"given" : [
"Beatris270"
],
"use" : "official"
}
],
"resourceType" : "Patient",
"telecom" : [
{
"system" : "phone",
"use" : "home",
"value" : "555-339-8605"
}
],
"text" : {
"div" : "<div xmlns="http://www.w3.org/1999/xhtml\">Generated by <a href="https://github.com/synthetichealth/synthea\">Synthea.Version identifier: 36ca5da\n . Person seed: -7838029442944994561 Population seed: 1699997975546",
"status" : "generated"
}
}
Reproduction
n/a
Additional context
No response
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions