- Log in to post comments
Scott,
The trick is in using the appropriate syntax to access the individual fields within the DICOM message. In the example below, we're extracting data from the DICOM message to insert into a simple scheduling request message output as XML. The same syntax can be used in reverse, writing from HL7 into DICOM. Since the DICOM message is not fully-defined within Ensemble/HealthShare, the graphical DTL editor view is not pretty...
Hope this helps,
Mike
Class Test.Transform.DICOMToPatientSchedule Extends Ens.DataTransformDTL [ DependsOn = (EnsLib.DICOM.Document, Test.Msg.PatientScheduleReq) ]
{
Parameter IGNOREMISSINGSOURCE = 1;
Parameter REPORTERRORS = 1;
Parameter TREATEMPTYREPEATINGFIELDASNULL = 0;
XData DTL [ XMLNamespace = "http://www.intersystems.com/dtl" ]
{
<transform sourceClass='EnsLib.DICOM.Document' targetClass='Test.Msg.PatientScheduleReq' targetDocType='2.3.1:ADT_A01' create='new' language='objectscript' >
<assign value='source.GetValueAt("DataSet.PatientID")' property='target.PID' action='set' />
<assign value='"DICOM"' property='target.MessageSource' action='set' />
<assign value='source.GetValueAt("DataSet.PatientName")' property='target.PatientName' action='set' />
<assign value='source.GetValueAt("DataSet.ScheduledProcedureStepSequence[1].ScheduledProcedureStepStartDate")' property='target.ExamDateTime' action='set' />
<assign value='source.GetValueAt("DataSet.ScheduledProcedureStepSequence[1].ScheduledProcedureStepStartDate")' property='target.FileDate' action='set' />
<assign value='source.GetValueAt("DataSet.ScheduledProcedureStepSequence[1].ScheduledProcedureStepDescription")' property='target.ExamType' action='set' />
<assign value='source.GetValueAt("DataSet.AccessionNumber")' property='target.AccessionNumber' action='set' />
<assign value='source.GetValueAt("DataSet.StudyInstanceUID")' property='target.VisitId' action='set' />
<assign value='source.GetValueAt("DataSet.ScheduledProcedureStepSequence[1].ScheduledPerformingPhysicianName")' property='target.AttendingPhysician' action='set' />
</transform>
}
}
- Log in to post comments
I've just been working on such a transformation...
As the HS.SDA3.Container class reference states:
If you wish to use the Container for DTL, do it as an XML Vdoc. When HealthShare is installed, we import the XML schema into the HSLIB namespace to make it available. See methods ExportXMLSchema and ExportXMLSchemaAPI for how to export the XML schema.
You'll need to export the SDA3 schema to a file :
TEST>do ##class(HS.SDA3.Container).ExportXMLSchemaAPI("C:\sda3.xsd")
Then import that file into your namespace via the System Management Portal:
Interoperability -> Interoperate -> XML -> XML Schema Structures -> Import
Here is a snippet of a custom Business Process I'm using to transform an HL7 message to SDA3 and then transform the SDA3 to a class used for insertion into an RDBMS. Be sure that your DTL specifies the same Source Class (EnsLib.EDI.XML.Document) and the Source Doc Type (sda3:Container) as you've coded below so that you'll see all fields in the DTL Editor:
set tSC = ##class(HS.Gateway.HL7.HL7ToSDA3).GetSDA(pRequest,.tSDAStream)
set tRDBMS = ##class(Test.RDBMS).%New()
set tVDoc = ##class(EnsLib.EDI.XML.Document).%New(tSDAStream)
set tVDoc.DocType = "sda3:Container"
set tSC = ##class(Test.SDAtoRDBMS).Transform(tVDoc,.tRDBMS)
I hope this helps!