Question
· May 25, 2021

How to convert fhir R4 to SDA through iris, is there any specific link

I cannot convert the R4 version of the JSON file through the built-in dtl, and convert it to SDA, I hope to get an answer, thank you very much

Product version: IRIS 2020.1
Discussion (3)0
Log in or sign up to continue

Hi Xiong,

To convert FHIR R4 to SDA you have to use this helper class :

HS.FHIR.DTL.Util.HC.FHIR.SDA3.Process

This class take in input a message of this kind : HS.FHIRServer.Interop.Request or HS.Message.FHIR.Request.

So if you want to convert an json FHIR file to SDA, you have to read the file from a business service cast you file to one of this message and send it to the helper class.

Here is and Business service example of reading fhir json files :

Class BS.FHIRFileService Extends Ens.BusinessService
{

Parameter ADAPTER = "EnsLib.File.InboundAdapter";

Property TargetConfigNames As %String(MAXLEN = 1000) [ InitialExpression = "BusinessProcess" ];

Parameter SETTINGS = "TargetConfigNames:Basic:selector?multiSelect=1&context={Ens.ContextSearch/ProductionItems?targets=1&productionName=@productionId}";

Method OnProcessInput(pDocIn As %RegisteredObject, Output pDocOut As %RegisteredObject) As %Status
{
    set status = $$$OK

    try {

        set pInput = ##class(HS.FHIRServer.Interop.Request).%New()
        set tQuickStream = ##class(HS.SDA3.QuickStream).%New()
        do tQuickStream.CopyFrom(pDocIn)
        set pInput.QuickStreamId= tQuickStream.Id


        for iTarget=1:1:$L(..TargetConfigNames, ",") {
            set tOneTarget=$ZStrip($P(..TargetConfigNames,",",iTarget),"<>W")  Continue:""=tOneTarget
            $$$ThrowOnError(..SendRequestSync(tOneTarget,pInput,.pDocOut))
        }
    } catch ex {
        set status = ex.AsStatus()
    }

    Quit status
}

}

You can find more information from this documentation :

https://docs.intersystems.com/irisforhealthlatest/csp/docbook/Doc.View.c...

You can't work directly in HSLIB, you have to create your own namespace to work with.

In a terminal :

zn "HSLIB"
// Install a Foundation namespace and change to it
Do ##class(HS.HC.Util.Installer).InstallFoundation("NEW_NAMESPACE")
zn "NEW_NAMESPACE"

If you are not familiar with Namespace, HSLIB, Ensemble first check for training here :

https://learning.intersystems.com/course/view.php?id=243