Stream: implementers
Topic: Referencing in bundle
Sandeep Rathore (Sep 01 2020 at 15:27):
Hi Everyone,
I have created a bundle resource from HL7 v2 meassage, in which I am sending full URL for each resource in order to reference in another resource, i have also used conditional update in few resources like - Patient Resource and Encounter resource based on the identifiers. My issue is - In fhir server it it creating 2 resources for a single resource from the bundle. one with the resource id with full url which is an empty resource and another with a new id for example - For a patient resource in a bundle- It is creating 2 patient resources, one with full content inside it and with new resource id and another with the full url id that I have given. Please refer the below json.
{
"resourceType": "Bundle",
"type": "transaction",
"entry": [
{
"fullUrl": "urn:uuid:9d1ca0a8-0cee-3747-814d-3ff9907939a9",
"resource": {
"resourceType": "Patient",
"id": "9d1ca0a8-0cee-3747-814d-3ff9907939a9",
"identifier": [
{
"use": "usual",
"system": "http://hospital.org/externalID",
"value": "NGM03126211"
},
{
"use": "usual",
"system": "http://mein-krankenhaus.de/NamingSystem/patient-identifier",
"value": "201991014"
},
{
"use": "secondary",
"system": "http://hospital.org/alternatePatientID",
"value": "201927815"
}
],
"name": [
{
"use": "official",
"text": "Donald",
"family": "Duck Donald",
"given": [
"Duck"
]
}
],
"birthDate": "1949-12-03",
"gender": "male",
"address": [
{
"line": [
"Main str. 10"
],
"city": "Berlin",
"postalCode": "72076",
"country": "Deuscheland",
}
],
"telecom": [
{
"value": "0176-3333355",
"system": "phone",
"use": "home"
},
{
"value": "07071-23332",
"system": "phone",
"use": "work"
}
],
"communication": [
{
"language": {
"coding": [
{
"system": "urn:ietf:bcp:47",
"code": "de",
"display": "German"
}
]
},
"preferred": true
}
],
"multipleBirthBoolean": false
},
"request": {
"method": "PUT",
"url": "Patient?identifier=http://mein-krankenhaus.de/NamingSystem/patient-identifier|201991014"
}
},
{
"fullUrl": "urn:uuid:2750731b-7408-3289-94f4-913df2982229",
"resource": {
"resourceType": "Practitioner",
"id": "2750731b-7408-3289-94f4-913df2982229",
"identifier": [
{
"value": "610732721"
}
],
"name": [
{
"family": "Test",
"given": [
"Test_Fr"
],
"prefix": [
"Dr. med."
]
}
],
"address": [
{
"line": [
"Unknownstr. 13"
],
"city": "Herrenberg",
"postalCode": "71083",
"country": "Deutschland"
}
]
},
"request": {
"method": "POST",
"url": "Practitioner",
"ifNoneExist": "identifier=610732721"
}
},
{
"fullUrl": "urn:uuid:5dff23ec-e5e1-36a4-9094-249ea4f0b160",
"resource": {
"resourceType": "Practitioner",
"id": "5dff23ec-e5e1-36a4-9094-249ea4f0b160",
"identifier": [
{
"value": "618239221"
}
],
"name": [
{
"family": "Test2",
"given": [
"Uknown"
],
"prefix": [
"Dr. med."
]
}
],
"address": [
{
"line": [
"Str. 3"
],
"city": "Herrenberg",
"postalCode": "71083",
"country": "Deutschland"
}
]
},
"request": {
"method": "POST",
"url": "Practitioner",
"ifNoneExist": "identifier=618239221"
}
},
{
"fullUrl": "urn:uuid:cbee8c1f-9933-3dd3-b62f-c91b87574cf6",
"resource": {
"resourceType": "Condition",
"id": "cbee8c1f-9933-3dd3-b62f-c91b87574cf6",
"code": {
"coding": [
{
"system": "https://www.dimdi.de",
"code": "M65.4",
"display": "Tendovaginitis stenosans (de Quervain)"
},
{
"system": "https://www.dimdi.de",
"code": "M65.41",
"display": "Tendovaginitis stenosans (de Quervain)"
}
],
"text": "Tendovaginitis stenosans (de Quervain)"
},
"onsetDateTime": "2020-08-11T11:32:46.000Z",
"subject": {
"reference": "Patient/9d1ca0a8-0cee-3747-814d-3ff9907939a9"
}
},
"request": {
"method": "POST",
"url": "Condition"
}
},
{
"fullUrl": "urn:uuid:63fc6ebf-83f3-3d74-b76b-be16557c4e61",
"resource": {
"resourceType": "Condition",
"id": "63fc6ebf-83f3-3d74-b76b-be16557c4e61",
"code": {
"coding": [
{
"system": "https://www.dimdi.de",
"code": "M65.4",
"display": "Tendovaginitis stenosans"
},
{
"system": "https://www.dimdi.de",
"code": "M65.40",
"display": "Tendovaginitis stenosans"
}
],
"text": "Tendovaginitis stenosans"
},
"onsetDateTime": "2019-06-13T18:24:13.000Z",
"subject": {
"reference": "Patient/9d1ca0a8-0cee-3747-814d-3ff9907939a9"
}
},
"request": {
"method": "POST",
"url": "Condition"
}
},
{
"fullUrl": "urn:uuid:5c4ffa26-3806-382f-8a85-f21c2afd4ecf",
"resource": {
"resourceType": "Encounter",
"id": "5c4ffa26-3806-382f-8a85-f21c2afd4ecf",
"class": {
"code": "AMB",
"display": "ambulatory",
"system": "http://terminology.hl7.org/CodeSystem/v3-ActCode"
},
"status": "finished",
"location": [
{
"location": {
"display": "Hospital "
},
"status": "active"
}
],
"participant": [
{
"type": [
{
"coding": [
{
"code": "REF",
"system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType",
"display": "referrer"
}
]
}
],
"individual": {
"reference": "Practitioner?identifier=610732721"
}
},
{
"type": [
{
"coding": [
{
"code": "CON",
"system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType",
"display": "consultant"
}
]
}
],
"individual": {
"reference": "Practitioner?identifier=618239221"
}
}
],
"identifier": [
{
"type": {
"coding": [
{
"system": "http://terminology.hl7.org/CodeSystem/v2-0203",
"code": "VN",
"display": "Visit number"
}
]
},
"system": "http://hospital/visitID",
"value": "201927815"
}
],
"period": {
"start": "2019-05-09T10:49:00.000Z",
"end": "2019-12-31T23:59:00.000Z"
},
"subject": {
"reference": "Patient/9d1ca0a8-0cee-3747-814d-3ff9907939a9"
},
"diagnosis": [
{
"condition": {
"reference": "Condition/cbee8c1f-9933-3dd3-b62f-c91b87574cf6"
}
},
{
"condition": {
"reference": "Condition/63fc6ebf-83f3-3d74-b76b-be16557c4e61"
}
}
]
},
"request": {
"method": "PUT",
"url": "Encounter?identifier=http://hospital/visitID|201927815"
}
},
{
"fullUrl": "urn:uuid:74110a3b-fc68-35e6-99ec-72e70a266a07",
"resource": {
"resourceType": "Procedure",
"id": "74110a3b-fc68-35e6-99ec-72e70a266a07",
"status": "completed",
"code": {
"coding": [
{
"system": "https://www.dimdi.de",
"code": "5-984",
"display": "Mikrochirurgische Technik - Zusatzcode"
}
],
"text": "Mikrochirurgische Technik - Zusatzcode"
},
"performedDateTime": "2019-06-14T08:22:00.000Z",
"category": {
"coding": [
{
"code": "OP"
}
]
},
"subject": {
"reference": "Patient/9d1ca0a8-0cee-3747-814d-3ff9907939a9"
}
},
"request": {
"method": "POST",
"url": "Procedure"
}
}
]
}
Lloyd McKenzie (Sep 01 2020 at 15:47):
That sounds like something to take up with the author of the server...
Sandeep Rathore (Sep 01 2020 at 19:30):
Hi Lloyd,
It seems mean while patient resource is looking for identifier using conditional put, it creates another resource from the bundle which contains reference to this patient resource and when this referenced patient is not found then, it creates another resource with this reference id.
Paul Church (Sep 01 2020 at 19:33):
We don't know what server you are using. There are many different implementations of FHIR.
Sandeep Rathore (Sep 01 2020 at 19:36):
I am using Hapi Fhir JPA
Vassil Peytchev (Sep 01 2020 at 19:46):
You may get a faster answer in the #hapi stream. Also, if you have your bundle in a file, you may attach it to your post there, as it may be easier to review, compared to pasting it in the post...
Sandeep Rathore (Sep 01 2020 at 19:49):
Sure, Thanks for suggesting
Last updated: Apr 12 2022 at 19:14 UTC