Trouble with PATCH operation using .NET Firely SDK for EPIC FHIR Integration

34 views Asked by At

I'm integrating EPIC FHIR into our C# application using the .NET Firely SDK. I've successfully created a patient using the provided resources, but I'm encountering an issue with the PATCH operation. I'm strictly following the .net firely sdk documentation for doing the same. https://docs.fire.ly/projects/Firely-NET-SDK/en/latest/client/crud.html#patching-resources

I'm attempting to update a patient's birth date using the following payload:

var patch = new Parameters();
patch.Parameter.Add(new Parameters.ParameterComponent()
{
    Name = "OPERATION",
    Part = new List<Parameters.ParameterComponent>()
        {
            new Parameters.ParameterComponent()
            {
                    Name = "type",
                    Value = new FhirString("replace")
            },
            new Parameters.ParameterComponent()
            {
                    Name = "path",
                    Value = new FhirString("Patient.BirthDate")
            },
            new Parameters.ParameterComponent()
            {
                    Name = "value",
                    Value = new FhirString("2003-02-12")
            }
        }
});
var r = await _fhirClient.PatchAsync<Patient>(url, patch);

However, this PATCH operation is failing with an InternalServerError. The OperationOutcome returned contains the message "There was an error processing your request."

Error : Hl7.Fhir.Rest.FhirOperationException HResult=0x80131500 Message=Operation was unsuccessful, and returned status InternalServerError. OperationOutcome: Overall result: FAILURE (1 errors and 0 warnings) [ERROR] (no details)(further diagnostics: There was an error processing your request.)

I've verified the request payload, the URL, and the permissions. Could someone please advise on how to troubleshoot or resolve this issue?

1

There are 1 answers

2
Ashavan On

Epic doesn't offer a Patient.Update FHIR API. If you're trying to update patient demographics via an API, you'll need to use a private API (available through the Vendor Services program only).