Question
· Dec 25

FHIR facade, override FHIR Search and return OperationOutcome

Hello,

I'm trying to customize error handling in the overriden HS.FHIRServer.Storage.JsonAdvSQL.Interactions::Search method. It is clear how to add to the resultset a valid FHIR resource (pseudocode):

Method Search(pResourceType As %String, pCompartment As %String, pCompartmentId As %String, pParameters As HS.FHIRServer.API.Data.QueryParameters = "", ByRef pSortKeys = "") As HS.FHIRServer.Util.SearchResult
{
    #Dim resultSet as HS.FHIRServer.Util.SearchResult
    Set resultSet = ##class(HS.FHIRServer.Util.SearchResult).Create()

    If (pResourceType = "Patient")
    {
        Set patientDynamicObject = ..MethodWhichLoadsPatient()
        Do resultSet.AddRow(somePatientId, "Patient", somePatientId, "1", "match",,patientDynamicObject)
        Return resultSet
    }
}

But, what should be done to add an error to the resultset? E.g.:

{
  "resourceType": "Bundle",
  "type": "searchset",
  "entry":
  [
    {
      // the `resource` property should be omitted
      "response": 
      {
         "status": 500,
         "outcome":
         {
           "resourceType": "OperationOutcome",
           ...
         }
      }
    }
  ]
}
Product version: IRIS 2024.3
Discussion (0)1
Log in or sign up to continue