microsoft / fhir-proxy

FHIR Proxy is a secure application that acts as an intermediary in the transfer of FHIR data to and from Azure API for FHIR/FHIR Server for Azure
MIT License
73 stars 50 forks source link

Get {{proxyfhirServerUrl}}/Procedure and {{proxyfhirServerUrl}}/Goal requests are not working #82

Closed Kedar782 closed 1 year ago

Kedar782 commented 1 year ago

Hello team,

I'm trying to retrieve the fhir procedure and Goal resources using postman.

I'm getting an error stating Could not find Patient Reference Patient/26b8f4f5-441f-481e-b50a-0cd265df4f08 in reference fields patient, performer of resource Procedure/16b495e0-c8d7-4ea4-8805-ac9a9498321c and Could not find Patient Reference Patient/26b8f4f5-441f-481e-b50a-0cd265df4f08 in reference fields patient of resource Goal/3cfadb39-d3b2-4efb-b9e7-504c6dd529d0.

If I use fhirserver Url without the proxy and make the same request, I get the correct result for both resources.

This proxy is trying to reference patient/26b8f4f5-441f-481e-b50a-0cd265df4f08 in Goal and Procedure resources. Goal and Procedure don't have a patient reference field in the FHIR R4 version.

Any idea how should I resolve this error? Goal and Procedure Resource:-

{ "resourceType": "Bundle", "id": "0c04e7af9f4e9e3f0d8e6e5c31e7053f", "meta": { "lastUpdated": "2022-11-29T02:13:52.4034336+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://azure-fhir-modified.azurehealthcareapis.com/Goal" } ], "entry": [ { "fullUrl": "https://azure-fhir-modified.azurehealthcareapis.com/Goal/3cfadb39-d3b2-4efb-b9e7-504c6dd529d0", "resource": { "resourceType": "Goal", "id": "3cfadb39-d3b2-4efb-b9e7-504c6dd529d0", "meta": { "versionId": "1", "lastUpdated": "2022-11-23T22:37:11.128+00:00", "source": "#iLFSV7OLv0KF8dmQ", "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-goal" ] }, "lifecycleStatus": "active", "description": { "coding": [ { "system": "http://snomed.info/sct", "code": "281004", "display": "Alcoholic dementia" } ], "text": "Alcoholic dementia" }, "subject": { "reference": "Patient/26b8f4f5-441f-481e-b50a-0cd265df4f08" }, "target": [ { "dueDate": "2020-12-07" } ] }, "search": { "mode": "match" } } ] }

{ "resourceType": "Bundle", "id": "3f193d686ae0e5957b397523b42eb866", "meta": { "lastUpdated": "2022-11-29T01:05:57.4453493+00:00" }, "type": "searchset", "link": [ { "relation": "self", "url": "https://azure-fhir-modified.azurehealthcareapis.com/Procedure" } ], "entry": [ { "fullUrl": "https://azure-fhir-modified.azurehealthcareapis.com/Procedure/16b495e0-c8d7-4ea4-8805-ac9a9498321c", "resource": { "resourceType": "Procedure", "id": "16b495e0-c8d7-4ea4-8805-ac9a9498321c", "meta": { "versionId": "1", "lastUpdated": "2022-11-23T22:48:56.424+00:00", "source": "#E1VolYkq84D3M96u", "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-procedure" ] }, "status": "completed", "code": { "coding": [ { "system": "http://snomed.info/sct", "code": "430193006", "display": "Medication Reconciliation (procedure)" } ], "text": "Medication Reconciliation (procedure)" }, "subject": { "reference": "Patient/26b8f4f5-441f-481e-b50a-0cd265df4f08" }, "encounter": { "reference": "Encounter/63b9a51e-8db9-4aaa-b477-aa0c50fdb28d" }, "performedPeriod": { "start": "1962-06-01T01:11:45-04:00", "end": "1962-06-01T01:26:45-04:00" }, "location": { "reference": "Location/ca3ee226-241e-4c21-bafd-158cbe4a1c88", "display": "PCP87052" } }, "search": { "mode": "match" } } ] }

sordahl-ga commented 1 year ago

OK I believe I have resolved all the "subject" reference problems this time. Please resync your code. Resolved with the following committ https://github.com/microsoft/fhir-proxy/commit/d2fc705d8701168a7de215071ab23fadd240dd0c

I will leave it open this time until confirmation

Kedar782 commented 1 year ago

@sordahl-ga Thank you very much. This error got resolved by this. I'm still getting the 500 error for bulk data export. I followed the new step you added for the Multi Patient API test in this commit.

Kedar782 commented 1 year ago

I'm closing this issue. https://github.com/microsoft/fhir-proxy/commit/d2fc705d8701168a7de215071ab23fadd240dd0c solved it.