Question
· Sep 28, 2022

Ens.DataTransform

Hi ,

I am Converting HL7 message into SDA3 format by using  Ens.DataTransform Class but transformation is not happening while using this class and throwing the below error

ERROR <Ens>ErrException: <UNDEFINED>zTransform+1^Hosiptal.SDA3.DataTrans.1 *target -- logged as '-' number - @' Set target.Patient.Name=source.GetValueAt("PID:5")'

Let me know if any mistake please refer the below code

Class Hosiptal.SDA3.DataTrans Extends Ens.DataTransform
{

ClassMethod Transform(source As EnsLib.HL7.Message, target As HS.SDA3.Container) As %Status
{
 
   Set target.Patient.Name=source.GetValueAt("PID:5")
   Set target.Patient.BirthGender=source.GetValueAt("PID:8")
 
   Set $ZT="Trap",tSC=$$$OK
do {
$$$ASSERT(0) // Subclass Responsibility
Set tSC = $$$EnsError($$$EnsErrNotImplemented,$$$CurrentClass,$$$CurrentMethod)
while (0)
Exit
Quit tSC
Trap
Set $ZT="",tSC=$$$EnsSystemError
Goto Exit
} }
 

 

Thanks,

Smythee

Product version: Ensemble 2018.1
$ZV: Cache for Windows (x86-64) 2018.1.1 (Build 312_1_18937U) Fri Apr 26 2019 17:58:36 EDT
Discussion (15)1
Log in or sign up to continue

You need to create HS.SDA3.Container object in Transform method before using it. Something like this:

Class Hosiptal.SDA3.DataTrans Extends Ens.DataTransform
{

ClassMethod Transform(source As EnsLib.HL7.Message, ByRef target As HS.SDA3.Container, aux) As %Status
{
    #Dim sc As %Status = $$$OK
    Set sc =  ##class(HS.Gateway.HL7.HL7ToSDA3).GetSDA(source, .xml)
    Quit:$$$ISERR(sc) sc
    Set target = ##class(HS.SDA3.Container).%New()
    Set sc = target.InitializeXMLParse(.xml)
    Quit sc
}

}

I am getting ERROR <Ens>ErrNotImplemented: Method Hosiptal.SDA3.DataTrans.Transform() not implemented error 

Please find the method i am using 

ClassMethod Transform(source As EnsLib.HL7.Message, ByRef target As HS.SDA3.Container) As %Status
{
   Set sc= ##class(HS.Gateway.HL7.HL7ToSDA3).GetSDA(source, .xml)
   Set target=##class(HS.SDA3.Container).%New()
   Do target.InitializeXMLParse(.xml)
   Set target.Patient.Name=source.GetValueAt("PID:5")
   Set target.Patient.BirthGender=source.GetValueAt("PID:8")
   Set $ZT="Trap",tSC=$$$OK
do {
$$$ASSERT(0) // Subclass Responsibility
Set tSC = $$$EnsError($$$EnsErrNotImplemented,$$$CurrentClass,$$$CurrentMethod)
while (0)
Exit
Quit tSC
Trap
Set $ZT="",tSC=$$$EnsSystemError
Goto Exit
} }
 

Yes, well, you explicitly set your error in:

do {
$$$ASSERT(0) // Subclass Responsibility
Set tSC = $$$EnsError($$$EnsErrNotImplemented,$$$CurrentClass,$$$CurrentMethod)
} while (0)
Exit
Quit tSC
Trap
Set $ZT="",tSC=$$$EnsSystemError
Goto Exit
} 

You need to remove that.

Also Patient info should be in SDA already, so you can remove:

Set target.Patient.Name=source.GetValueAt("PID:5")
Set target.Patient.BirthGender=source.GetValueAt("PID:8")

Ok thank you 

I have done the same in my studio but in custom business process i m not getting the value of transformed message 

my business process looks like this

Method OnRequest(pRequest As Ens.Request, Output pResponse As Ens.Response) As %Status
{
   
   Set tSC=##class(Hosiptal.SDA3.DataTrans).Transform(pRequest)
   Set NewObj=##class(%Library.GlobalCharacterStream).%New()
   Set pRequest=##class(Ens.StreamContainer).%New(NewObj)
   Set tOneTarget=..TargetConfigNames
   Set tSC=$$$OK   $$$LOGINFO("tSC"_tSC) For iTarget=1:1:$L(..TargetConfigNames, ",") Set tOneTarget=$ZStrip($P(..TargetConfigNames,",",iTarget),"<>W") Continue:""=tOneTarget
   Set tSC1=..SendRequestAsync(tOneTarget,pRequest) Quit:$$$ISERR(tSC)
   Set:$$$ISERR(tSC1) tSC=$$$ADDSC(tSC,tSC1)
   }
}

Hi,

Can you please explain the need of passing xml value into HS.Gateway.HL7.HL7ToSDA3 class

ClassMethod Transform(source As EnsLib.HL7.Message, ByRef target As HS.SDA3.Container, aux) As %Status {

#Dim sc As %Status = $$$OK

Set sc = ##class(HS.Gateway.HL7.HL7ToSDA3).GetSDA(source, .xml) Quit:$$$ISERR(sc) sc

Set target = ##class(HS.SDA3.Container).%New()

Set sc = target.InitializeXMLParse(.xml)

Quit sc

Thank you,

Smythee

}