Question
· Feb 16, 2023

Does FHIR server in the IRIS for Health Community Edition support Conditional Create/Update and resolve uuid references?

This YouTube video about submitting a FHIR transaction bundle impressed me. It shows me two things:

  1. how a new resource (in the video, the Observation) referencing another new resource (the Patient) in the same bundle can be done, given that their link-up will be sorted out in the repository and reflected in the subsequent retrieval through a HTTP GET; and
  2. how a conditional create with the PUT method may be achieved, in case we cannot tell if such a resource (e.g. the Patient with an identifier) to be submitted may or may not exist.

Lately I tried to follow the steps in the video and work them out with IRIS for Health Community Edition. I used POSTMAN to submit my FHIR bundle with a HTTP POST.

My result is:

  1. The conditional create with the PUT method (for that Patient) seems not working. It returned me the error message No resource with type 'Patient' and id ''"
  2. If I made a POST method call first so to create the Patient in the first place, followed by sending the bundle again, both Patient and ServiceRequest resources could be saved and the code 201 returned. Yet if then I made a GET method call to retrieve them, that ServiceRequest does not link with the Patient in the repository (the reference of the "subject" of ServiceRequest is still that dummy URN "urn:uuid:patient" instead of a repository reference, something I expected as "Patient/1").

Anyone could shed me lights on how to make my bundle work with the conditional create? 

Content of FHIR transacton bundle file prepared is shown here (and as mentioned, I submitted this bundle to /csp/healthshare/fhirserver/fhir/r4), where I defined a Patient and a ServiceRequest referencing to that Patient.

{
    "resourceType": "Bundle",
    "type": "transaction",
    "entry": [
        {
            "fullUrl": "urn:uuid:patient",
            "resource": {
                "resourceType": "Patient",
                "active": true,
                "birthDate": "1970-04-12",
                "gender": "female",
                "identifier": [
                    {
                      "type": {
                        "coding": [
                          {
                            "system": "http://myterminology.com",
                            "code": "1001949"
                          }
                        ]
                      },
                      "use": "usual",
                      "value": "A1234563"
                    }
                ],
                "name": [
                    {
                        "family": "CHAN",
                        "given": [
                            "CLARA"
                        ],
                        "use": "official"
                    }
                ]
            },
            "request": {
                "method": "PUT",
                "url": "Patient?identifier=A1234563"
            }
        },
        {
            "resource": {
                "resourceType": "ServiceRequest",
                "requisition": {
                    "system": "http://myexample.com",
                    "value": "H2302-10648"
                },
                "status": "active",
                "intent": "original-order",
                "category": [
                    {
                        "coding": [
                            {
                                "system": "http://snomed.info/sct",
                                "code": "108252007"
                            }
                        ]
                    }
                ],
                "priority": "routine",
                "code": {
                    "coding": [
                        {
                            "system": "http://myexample.com",
                            "code": "CBC"
                        }
                    ]
                },
                "subject": {
                    "type": "Patient",
                    "reference": "urn:uuid:patient"
                },
                "authoredOn": "2023-02-08T08:40:00+08:00"
            },
            "request": {
                "method": "POST",
                "url": "ServiceRequest"
            }
        }
    ]
}
Product version: IRIS 2022.1
$ZV: IRIS for UNIX (Ubuntu Server LTS for x86-64 Containers) 2022.1 (Build 209U) Tue May 31 2022 12:28:22 EDT [Health:3.5.0]
Discussion (4)3
Log in or sign up to continue

Having modified a bit the FHIR bundle transaction and tested again. This time it helped prevent having the same Patient resource created twice, which is already good enough for me.

But the "fullUrl" reference of the Patient resource still cannot get resolved with the logical reference. I'm a bit disappointed with that the value of the "subject"."reference of the ServiceRequest got unchanged.

Here is the FHIR Bundle Transaction sent to /csp/healthshare/fhirserver/fhir/r4 (places bold are those modified):

{
    "resourceType": "Bundle",
    "type": "transaction",
    "entry": [
        {
            "fullUrl": "urn:uuid:patient",
            "resource": {
                "resourceType": "Patient",
                "active": true,
                "birthDate": "1970-04-12",
                "gender": "female",
                "identifier": [
                    {
                        "type": {
                            "coding": [
                                {
                                    "system": "http://myterminology.com",
                                    "code": "1001949"
                                }
                            ]
                        },
                        "use": "usual",
                        "value": "A1234563"
                    }
                ],
                "name": [
                    {
                        "family": "CHAN",
                        "given": [
                            "CLARA"
                        ],
                        "use": "official"
                    }
                ]
            },
            "request": {
                "method": "POST",
                "url": "Patient",
                "IfNoneExist": "identifier=A1234563"
            }
        },
        {
            "resource": {
                "resourceType": "ServiceRequest",
                "requisition": {
                    "system": "http://myexample.com",
                    "value": "H2302-10648"
                },
                "status": "active",
                "intent": "original-order",
                "category": [
                    {
                        "coding": [
                            {
                                "system": "http://snomed.info/sct",
                                "code": "108252007"
                            }
                        ]
                    }
                ],
                "priority": "routine",
                "code": {
                    "coding": [
                        {
                            "system": "http://myexample.com",
                            "code": "CBC"
                        }
                    ]
                },
                "subject": {
                    "type": "Patient",
                    "reference": "urn:uuid:patient"
                },
                "authoredOn": "2023-02-08T08:40:00+08:00"
            },
            "request": {
                "method": "POST",
                "url": "ServiceRequest"
            }
        }
    ]
}

And here is the response of the HTTP GET from /csp/healthshare/fhirserver/fhir/r4/ServiceRequest/53 for viewing the ServiceRequest resource after having the FHIR bundle submitted (note that the reference of "subject" in the ServiceRequest resource does not resolve into a logical reference):

{
    "resourceType": "ServiceRequest",
    "requisition": {
        "system": "http://myexample.com",
        "value": "H2302-10648"
    },
    "status": "active",
    "intent": "original-order",
    "category": [
        {
            "coding": [
                {
                    "system": "http://snomed.info/sct",
                    "code": "108252007"
                }
            ]
        }
    ],
    "priority": "routine",
    "code": {
        "coding": [
            {
                "system": "http://myexample.com",
                "code": "CBC"
            }
        ]
    },
    "subject": {
        "type": "Patient",
        "reference": "urn:uuid:patient"
    },
    "authoredOn": "2023-02-08T08:40:00+08:00",
    "id": "53",
    "meta": {
        "lastUpdated": "2023-02-16T15:39:14Z",
        "versionId": "1"
    }
}

And here is the response of the HTTP GET from /csp/healthshare/fhirserver/fhir/r4/Patient/52 for viewing the Patient resource:

{
    "resourceType": "Patient",
    "active": true,
    "birthDate": "1970-04-12",
    "gender": "female",
    "identifier": [
        {
            "type": {
                "coding": [
                    {
                        "system": "http://myterminology.com",
                        "code": "1001949"
                    }
                ]
            },
            "use": "usual",
            "value": "A1234563"
        }
    ],
    "name": [
        {
            "family": "CHAN",
            "given": [
                "CLARA"
            ],
            "use": "official"
        }
    ],
    "id": "52",
    "meta": {
        "lastUpdated": "2023-02-16T15:39:14Z",
        "versionId": "1"
    }
}

Hi Tani,

The Support for conditional update for a ressource seems to exists also in iris for health Version 2022.1.3 (at least docs state this). Van you confirm that? Bades in josephs example from above what could the conditional Update on Patient ressource Look Like? Asfaik the conditional update could insert a non existing resource as well.

best Regards,

sebastian