Yes thank you 

but i am getting different error after transforming the message. I think the error is the way i defined the my custom schema and getting error in this class "EnsLib.EDI.XML.Document".let me know any mistake while defining the schema please

<PROPERTY DOES NOT EXIST>zTransform+7^CSTOM.TXML.XMLToHL7.1 *MSH,EnsLib.EDI.XML.Document -- logged as '-' number - @' Set tSC1=target.SetValueAt(source.MSH.EncodingCharacters,"MSH:EncodingCharacters","set","")'

Transformation is working fine. I am getting output from my transformation but when i am using same transformation in Business process.

Let me know any changes do i need to make in transformation 

XData DTL [ XMLNamespace = "http://www.intersystems.com/dtl]
{
<transform sourceClass='CUSTOM.TXML.MainSchema' targetClass='EnsLib.HL7.Message' targetDocType='2.5:ADT_A01' create='new' language='objectscript' >
<assign value='source.FieldSeparator' property='target.{MSH:FieldSeparator}' action='set' />
<assign value='source.EncodingCharacters' property='target.{MSH:EncodingCharacters}' action='set' />
<assign value='source.SendingApplication' property='target.{MSH:SendingApplication}' action='set' />
<assign value='source.PatientID' property='target.{PID:SetIDPID}' action='set' />
<assign value='source.FamilyName' property='target.{PID:PatientName().FamilyName}' action='set' />
<assign value='source.GivenName' property='target.{PID:PatientName().GivenName}' action='set' />
</transform>
}
 

For incoming XML i have custom schema which looks like the below 

Class CUSTOM.TXML.MainSchema Extends (%Persistent, %XML.Adaptor)
{

Property FieldSeparator As %String;

Property EncodingCharacters As %String;

Property SendingApplication As %String;

Property SendingFacility As %String;

}

Let me know any mistakes that i have made in this class please?

Thanks,

Smythee

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

}

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)
   }
}

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
} }