Stream: social
Topic: How to use fhir extension with a short name
Gang Chen (Mar 06 2017 at 15:53):
Lloyed and all,
Gang Chen (Mar 06 2017 at 16:00):
Lloyed and all, I have POST the data into an extened field of a collection in FHIR server with following fhir extension document. But when GET the data, it seems the fhir server only returned the url other than an extended field name. Does anyone know how to do it ?
Grahame Grieve (Mar 06 2017 at 19:59):
I think you'll have to provide examples
Lloyd McKenzie (Mar 06 2017 at 22:16):
@Gang Chen This would typically be an implementer thread topic rather than social stream (for next time). If you can share exactly what you're posting and getting back we may be able to help more.
Gang Chen (Mar 07 2017 at 14:26):
Lloyd and Grahame, I will put a subject into a proper stream next time. Here is the example for POST and GET. As you can see, both field diagnosed and dateEstimated are extended from AllergIntolerance. When GET the data, the fhir server did not return both extended fields as we expected, i.e.
......
"extension":[{"diagnosed": true}, {"dateEstimated": true}]
......
Example:
POST: http://34.194.17.236/hapi-fhir-jpaserver-example/AllergyIntolerance
Data Body:
{
"resourceType":"AllergyIntolerance",
"category":"medication",
"patient":{"reference":"Patient/123"},
"substance":{
"coding":[{
"display":"Citrus Allergy",
"code":418085001,
"system":"http://snomed.info/sct"
}]
},
"onset":"2017-02-01T00:00:00-05:00",
"extension": [
{
"url": "http://34.194.17.236/hapi-fhir-jpaserver-example/StructureDefinition/allergyintolerance-diagnosed",
"valueBoolean": true
},
{
"url": "http://34.194.17.236/hapi-fhir-jpaserver-example/StructureDefinition/allergyintolerance-dateEstimated",
"valueBoolean": true
}
]
}
GET: http://34.194.17.236/hapi-fhir-jpaserver-example/AllergyIntolerance
Data result:
{
"fullUrl": "http://34.194.17.236/hapi-fhir-jpaserver-example/AllergyIntolerance/58b85ccc2ab79c00096fad83",
"resource": {
"resourceType": "AllergyIntolerance",
"id": "58b85ccc2ab79c00096fad83",
"meta": {
"versionId": "1",
"lastUpdated": "2017-03-02T17:56:28.866+00:00",
"profile": [
"http://hl7.org/fhir/profiles/AllergyIntolerance"
]
},
"extension": [
{
"url": "http://34.194.17.236/hapi-fhir-jpaserver-example/StructureDefinition/allergyintolerance-dateEstimated",
"valueBoolean": true
},
{
"url": "http://34.194.17.236/hapi-fhir-jpaserver-example/StructureDefinition/allergyintolerance-diagnosed",
"valueBoolean": true
}
],
"onset": "2017-02-01T00:00:00-05:00",
"patient": {
"reference": "Patient/123"
},
"substance": {
"coding": [
{
"system": "http://snomed.info/sct",
"code": "418085001",
"display": "Citrus Allergy"
}
]
},
"category": "medication"
}
}
Lloyd McKenzie (Mar 07 2017 at 18:44):
Why would you expect a short name?
Grahame Grieve (Mar 07 2017 at 19:27):
looks like the server returned what you provided, in a different order
Gang Chen (Mar 08 2017 at 15:23):
We'd like to POST the data for extended fields with using their short names (if this is possible), and GET the data under their short names, just similar to the reference field (see the patient in the above example).
Using the short name would reduce the parser burden of the front-end implementation, typically when there exist multiple collections with their extended fields.
Lloyd McKenzie (Mar 08 2017 at 16:40):
That's not possible because the only way to avoid collisions is with the full URL. Short names are not guaranteed to be unique and FHIR data needs to be interpretable by any arbitrary FHIR consumer anywhere in the world (that's what makes it a standard rather than proprietary interface). We understand the penalty this incurs in terms of instance size. We've explored various alternatives around namespacing approaches, etc. But this is the one the community has settled on so far as "least worst".
Gang Chen (Mar 09 2017 at 18:35):
Well, I am not quite understanding your statement "that is not possible because ... to avoid collisions...". Conceptually I thought a reference field is a special extension, isn't it ?
Last updated: Apr 12 2022 at 19:14 UTC