chronic-care / mcc-project

MCC eCare Plan project planning and documentation
Apache License 2.0
0 stars 1 forks source link

SDS Linkage search not returning requested resource #399

Closed mattStorer closed 3 months ago

mattStorer commented 4 months ago

It was identified recently that a search for Linkage resources against the SDS was not returning the requested resources, and was instead actually returning an error.

A query for a Linkage resource should look like this:

https://sds-mccecare-dev.ohsu.edu/fhir/Linkage?item=Patient/eFTHaVbQzCEwOEE97maN2MC2jJi-r8nnkhRh.umMUlz03

When executed, it should return the following Linkage resource that exists in the SDS:

{
  "resourceType": "Linkage",
  "item": [
    {
      "type": "source",
      "resource": {
        "reference": "Patient/79ec6e57-3baa-44ab-a0a8-2fc78c5d58dc"
      }
    },
    {
      "type": "alternate",
      "resource": {
        "reference": https://epicmobile.ohsu.edu/FHIRDEV/api/FHIR/R4/Patient/eFTHaVbQzCEwOEE97maN2MC2jJi-r8nnkhRh.umMUlz03
      }
    }
  ]
}

I say “should” because it appears that the SDS isn’t actually returning this Linkage resource when queried for it by the above URL. This is what is presently returned when I execute that call through Postman:

{
    "resourceType": "Bundle",
    "id": "95f43ac3-b8f3-423b-8960-a2e6c0aa6065",
    "meta": {
        "lastUpdated": "2024-04-25T12:11:46.262-07:00"
    },
    "type": "searchset",
    "link": [
        {
            "relation": "self",
            "url": http://sds-mccecare-dev.ohsu.edu/fhir/Linkage?item=Patient%2FeFTHaVbQzCEwOEE97maN2MC2jJi-r8nnkhRh.umMUlz03
        }
    ]
}

While this is a valid Bundle response, it doesn’t actually include the requested resource, although it seems to me that it should be included (but maybe I’m messing up the query?). The Linkage resource I specified above does exist in the SDS database in the local partition.

Curiously, if I perform the search for this Linkage passing in the source (local partition) Patient ID (Patient/79ec6e57-3baa-44ab-a0a8-2fc78c5d58dc), I get this:

https://sds-mccecare-dev.ohsu.edu/fhir/Linkage?item=Patient/79ec6e57-3baa-44ab-a0a8-2fc78c5d58dc

{
    "resourceType": "OperationOutcome",
    "issue": [
        {
            "severity": "error",
            "code": "processing",
            "diagnostics": "HAPI-2223: Cannot invoke \"String.equals(Object)\" because \"targetId\" is null"
        }
    ]
}
mattStorer commented 4 months ago

Tim has identified the cause of this issue as relating to how the Patient resource references are specified in the query, that they must be relative and not absolute, and has constructed a solution that should fix this issue, which I received yesterday and intend to test imminently.

kbertodatti commented 3 months ago

This should be fixed by latest updates from Tim Coffman.