Handling FHIR Responses in InterSystems – Transforming to SDA
I understand that InterSystems provides functions to facilitate transactions between FHIR and HL7 via the SDA segment. My question is:
- Does this transformation only work when InterSystems receives FHIR requests and converts them into HL7, or does it also support responses?
- Specifically, if our operation sends a GET request to a broker and receives a FHIR response, does InterSystems support transforming this response into an SDA segment automatically?
- Or should we manually parse and modify the response to handle it according to our needs?
What would be the best approach in this scenario? Any insights or best practices would be greatly appreciated!
Thanks in advance.
Product version: IRIS 2023.3
Hello @Ali Chaib
ClassMethod fhirresponse() { #;Assume the json as a fhir response Set fhiResponse = {"resourceType":"OperationOutcome","issue":[{"severity":"error","code":"not-found","diagnostics":"<HSFHIRErr>ResourceNotFound","details":{"text":"No resource with type 'Task' and id '33'"}}]} #dim opoutcome As HS.FHIRModel.R4.OperationOutcome = ##Class(HS.FHIRModel.R4.OperationOutcome).fromDao(fhiResponse) Write opoutcome.issue }
Thank you @Ashok Kumar
Yes, I fully understand that SDA (Summary Document Architecture) is an intermediary format.
And yes, I am using the HTTP operation in my interoperability production.
When you say "You need to programmatically convert the response", do you mean:
If the goal is to convert it into an object, does that mean I should manually read the JSON entities/nodes, extract the relevant information, and transform it directly into an HL7 message—bypassing SDA entirely?
If the goal is to convert it into SDA, does that mean I must first transform the FHIR response into a FHIR request? If so, how? Because FHIR responses often contain additional fields that do not appear in FHIR requests, such as:
"type": "searchset", "total": 1, "search": { "mode": "match" }
I’m asking these questions because, as you know, InterSystems provides built-in functionalities to automatically convert FHIR requests into SDA, such as:
HS.FHIR.DTL.Util.HC.FHIR.SDA3.Process
HS.FHIR.DTL.Util.API.Transform.FHIRToSDA3
These components accept FHIR requests and successfully transform them into SDA.
However, when handling FHIR responses, I tried extracting the payload, creating a new message, and sending it to
HS.FHIR.DTL.Util.HC.FHIR.SDA3.Process
. Unfortunately, the transformation failed—possibly because the FHIR response contains additional fields that the built-in functions don’t recognize.It's worth noting that when I send a FHIR request to the exact same process, it transforms correctly into SDA (without these extra fields).
Hello @Ali Chaib
FHIR to SDA
Yes we have built in transformation class available to FHIR ⇆ SDA and HS.FHIR.DTL.Util.API.Transform.FHIRToSDA3 is used to convert to SDA3 to FHIR
If you're goal to to convert to FHIR to SDA object then "HS.FHIR.DTL.Util.HC.SDA3.FHIR.Process" use this Business Process(BP) class to convert but this will send the request to BO again based on the BP configuration. Otherwise programmatically construct the input and pass the required values to the method in TransformStream class transformation class(which is in FHIR to SDA conversion business process) HS.FHIR.DTL.Util.API.Transform.SDA3ToFHIR for convert FHIR to SDA
SDA3 to HL7 conversion
from documentation. So, You need to read the JSON response, extract the required information, and transform it directly into an HL7 message
There are multiple DTL's available for SDA3 to HL7 v2 in package "HS.Gateway.SDA3.SDA3ToHL7." Can you check and utilize if it's helps
Thanks!