Question
· Jun 27

How to interpret FHIR.Interop.Response into Patient FHIR Bundle to use to enhance HL7 message

IRIS for UNIX (Red Hat Enterprise Linux 8 for x86-64) 2024.1 (Build 267_2U) Tue Apr 30 2024 16:06:39 EDT [HealthConnect:7.2.0-1.r1]

I have a use case where Epic is sending an A60 Allergy transaction is set at the Patient level, but we have a system called VIBE which needs the ADT at an Encounter level instead. Currently we store ADT information in a MS SQL database for years, and we are querying it to get the latest Account Number to insert into the ADT^A60 for VIBE.

This MS SQL Visit Database was built over 20 years ago and is quite cumbersome to keep maintaining. I would like us to move away from using this MS SQL Database, and query Epic directly.

One idea is to use Epic's FHIR repository to query and get the most resent Account Number to pass into the HL7 message. 

Using the FHIR Demo model to test the functionality to connect to Epic's FHIR repository. I am sending a request through HS.FHIRServer.Interop.HTTPOperation. Just recently I figured out the magic chant to get the Response back from Epic, however I am not sure what to do next.

How do I take the Quick Stream ID from JSON and put it into the FHIR Bundle Class Structure that I can pass back into the HL7 message via in a DTL?

$ZV: "IRIS for UNIX (Red Hat Enterprise Linux 8 for x86-64) 2024.1 (Build 267_2U) Tue Apr 30 2024 16:06:39 EDT"
Discussion (2)2
Log in or sign up to continue

#dim tResponse As HS.FHIRServer.Interop.Response
Set tSC = ..SendRequestSync(..TargetConfigName, tRequest, .tResponse)
if (($P(tResponse.Response.Status," ",1)>199) && ($P(tResponse.Response.Status," ",1)<399))
{ Set tResponseQuickStream = ##class(HS.SDA3.QuickStream).%OpenId(tResponse.QuickStreamId)
Set tSC = $$$ERROR($$$GeneralError, tResponseQuickStream.Read())
//Set BundleObject=##class(HS.FHIR.DTL.vR4.Model.Resource.Bundle).FromJSON(tResponseQuickStream,"vR4")
Set BundleObject=##class(%DynamicObject).%FromJSON(tResponseQuickStream)

}