Hi, Community!
🐍Great news—you can now use Python to customize your productions and add custom code!
IRIS supports Data Transformation Language (DTL) for describing data transformations. DTL is an XML language. Ensemble provides wizards and graphical tools for creating, editing, and testing DTL transformations. A data transformation is a Caché class like the following. If you prefer you can use Studio to edit the class definition directly and bypass the wizards and graphical tools.
Hi, Community!
🐍Great news—you can now use Python to customize your productions and add custom code!
I am struggling with returning a SQL Query Result that may have multiple rows that can be searched.
set query = "SELECT Facility FROM FROM osuwmc_EnterpriseDirDB.RelationshipMedCtrID WHERE OSUmedcenterID = ?"
SET rset = ##class(%SQL.Statement).%New()
SET qStatus = rset.%Prepare(query)
SET rset = rset.%Execute($Get(ID))
do rset.%Display()I need to take the values that are returned and say search them for a single value. How would I go about returning the EnsLib.SQL.Snapshot into a Array or List for it to be searchable.
I need a DTL to handle this.
Any ideas appreciated.
For all Prosthetics orders:
when ORC-1(Order Control) is "NW" (New Order), need to update OBR-18(Placer Field 1) based on PV1-2 (Patient Class) value.
assumption is that the selection logic is that all prosthetics orders with OBR-18 field is always blank.
Description :
If PV1-2 is I, insert I in OBR-18
If PV1-2 is O, insert O in OBR-18
If PV1-2 is E, insert O in OBR-18
If PV1-2 is P, insert O in OBR-18
If PV1-2 is R, insert O in OBR-18
If PV1-2 is B, insert O in OBR-18
New at DTL. I need some pointers on this DTL
For all Prosthetics orders:
when ORC-1(Order Control) is "NW" (New Order), need to update OBR-18(Placer Field 1) based on PV1-2 (Patient Class) value.
assumption is that the selection logic is that all prosthetics orders with OBR-18 field is always blank.
Description :
If PV1-2 is I, insert I in OBR-18
If PV1-2 is O, insert O in OBR-18
If PV1-2 is E, insert O in OBR-18
If PV1-2 is P, insert O in OBR-18
If PV1-2 is R, insert O in OBR-18
If PV1-2 is B, insert O in OBR-18
Hi everyone,
I'm working on a DTL that transforms an HL7 message (EnsLib.HL7.Message) to an XML document (EnsLib.EDI.XML.Document).
The target XML is based on a custom schema and has an element like:
What I need is for the output to show:
<deceasedDateTime xsi:nil="true"/> when the source HL7 value is empty, for eg:
<portalPatientUpdate xmlns:xsi="http://www.w3.
I need to add an extra blank OBX segment after a segment containing text, Total Cost:
I get the OBX segment but it is in incorrect location.
It should be after the line containing Total Cost:
It needs to contain:
code:
If (tOBXText[ "Total Cost:") {
Set tSegmentOBX = ##class(EnsLib.HL7.Segment).%New()
Set tSegmentOBX.SegType = "2.3:OBX"
Set tSC = tSegmentOBX.SetValueAt("OBX", 0, "set")
Set tSC = pOutput.
Trying to start investigating an error we are seeing with multiple of the same messages getting sent to the same vendor. We receive an HL7 message with an RTF embedded from our EMR, send it through a DTL to just update the Patient Class, and then send it onto the Operation which is TCP.
.png)
We are starting to see this error message...
ERROR <Ens>ErrBPTerminated: Terminating BP DocOutRptRouting3M360 # due to error: ERROR <Ens>ErrException: <INVALID OREF>zOutputToIOStream+6^EnsLib.HL7.Message.1 -- logged as '-' number - @''
> ERROR <Ens>ErrException: <INVALID OREF>zOutputToIOStream+6^EnsLib.
We are receiving the report in text format and it has special characters like ', - like that in the text. Source system is using the UTF8 encoding format hence the text is showing as ' � ' . Is there a way to convert the utf8 to actual character in the DTL.
Thank you,
Hi All,
After doing IRIS/Ensemble etc for 20 years I've come across a company who have very odd view, especially about DTL's and routers.
They have convinced themselves to use COS for transforms (including HL7) and for routers (and one of their 3rd party providers agree!)
Their reasons are; efficiency, compatibility, flexibility, power and re-usability.
Of course these reasons are wrong!
I was using VSCode to edit a DTL because it seemed easier to copy/paste code from parts of the DTL I was editing. I tried to add <sql> tag and code to call a SELECT statement, but when I compiled I got the following error...
ERROR <Ens>ErrInvalidDTL: Invalid DTL
> ERROR #5490: Error running generator for method 'GetSourceDocType:osuwmc.Epic.MFN.DTL.EpicMFN949002Normalization'
ERROR: Ens.DataTransformDTL.cls(GetSourceDocType) of generated code compiling subclass 'osuwmc.Epic.MFN.DTL.EpicMFN949002Normalization'
> ERROR #5030: An error occurred while compiling class 'osuwmc.Epic.MFN.
When removing a segment in DTL for hl7 using foreach the segment doesn't actually get removed and leaves a blank segment.
i.e.
MSH|^~\&|SendingSystem|ReceivingSystem|202301241000||ADT^A01|12345|P|2.4
EVN|S|202301241000
PID|1|MRN12345|1^^^^KEEP~2^^^^Remove~3^^^^Keep|M|19800101|
PD1|PatientAddress^Street^City^State^Zip
PV1|I|INPATIENT|BED123|DoctorID|202301241000|202301241000.png)
.png)
This blank segment to be removed
I read the notes and thought it might be about swizzling at https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?
We are using a DTL transformation to take HL7 and transform into custom XML. But the nodes in the resulting XML are appearing out of sequence - and therefore failing validation against the schema.
The XSD schema for the XML looks fine when imported into Ensemble: root node in the XSD looks like this:.png)
And shows in Ensemble like this:.png)
The transformation looks like this, and we can see the text from the trace elements at lines 5, 12 and 19 appear in the correct order in the event log:
.png)
HOWEVER, the resulting XML has the <allergies> nodes before the <patientNotes> nodes.
We are using a DTL transformation to take HL7 and transform into custom XML (XML is a virtual document, held in an EnsLib.EDI.XML.Document object). The schema specifying the format of the XML says one element should occur no more than 24 times (maxOccurs="24" in the XSD schema). However, the transformation to produce one such element always produces 24 elements, all but the last one blank, when tested stand-alone. And when the sub-transform producing one element is incorporated into the full transformation to produce the whole XML object, it produces the wrong output.
Hi, I am coming unstuck with a current mapping from HL7 to XML using the DTL editor with an XML schema (imported by XSD).
My output keeps prefixing the elements with "xsd_2" despite this not being defined in the targetnamespace within my XSD file.
Would anyone have any idea as to where this is creeping in? Any advice would be greatly appreciated.
My XSD namespace etc are setup as follows:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://voicetechnologies.co.uk/winvoice/importation"
xmlns="http://voicetechnologies.co.
Hello,
I hope this is a simple ask..
basically I need to create local files daily at a certain time for example 11:30pm.
1. file name needs to be like xxx__20250113.txt , the date part should be next day's timestamp with format YYYYMMDD, so I will write about 17 files like that with different names.
2. write a dummy hard coded word for example “Dummy Word” in the file. the file eventually will be used by other operations to add hl7 message on top of this in it with the live interface message.
3. this needs to be done every night at 11:45pm
So how am I going to implement this?
I'm glad to announce the new version of IoP, which by the way is not just a command line. I'm saying because the new AI search engine still thinks that IoP is just a command line. But it's not. It's a whole framework for building applications on top of the interoperability framework of IRIS with a python first approach.
The new version of IoP: 3.2.0 has a lot of new features, but the most important one is the support of DTL . 🥳
For both IoP messages and jsonschema. 🎉

Starting with version 3.2.0, IoP supports DTL transformations.
DTL the Data Transformation Layer in IRIS Interoperability.
DTL transformations are used to transform data from one format to another with a graphical editor.
It supports also jsonschema structures.
Hello,
is it possible to kill/suppress hl7 message in the DTL (data transformation).
in cloverleaf, it is common practice to check the value in message, for example pv1:7.9. if the value is certain word(assigning authority) then send the message over to destination, if it is not, kill the message
how would this be done in InterSystems ? does that need to be done in the rule instead? or can it be done in the data transformation? if it can be done in data transformation, how can it be done?
Thanks
We are building a data transformation from HL7 to custom XML. We've got an XML schema, and are using virtual documents (EnsLib.EDI.XML.Document).
We can:
.png)
Like many others probably find themselves, we were stuck doing live data mapping in our Interface Engine that we really didn't want to do, but had no good alternative choice. We want to only keep mappings for as long as possibly needed and then purge expired rows based upon a TTL value. We actually had 4 use cases for it ourselves before we built this. Use cases:
Has anybody encountered this before?
I did a very usual hl7 adt transformation DTL, but it is with a customized schema, like ADT_ALL, it is a structure that tries to cover all the ADT schema scenario so we can use 1 type for all ADT messages.
the DTL tests fine in DTL test, with all the segment transformed correctly, but once I put it to test, to send message through source and the message after transformation can only go to MSH, EVN, but won't transform other segment like PID etc.
Hi Team,
I am converting xml message into HL7 message but the input XML message contains pdf which is converting into base 64 and getting mapped to OBX:5.5 in HL7 message and sending it to downstream
In Downstream service i am using normal HL7 TCP class EnsLib.HL7.Service.TCPService but the message looks like below i am not sure why stream is taking as another segment in HL7 message,.png)
Any thoughts on this?
Thanks,
Smythee
I was working on a DTL but kept getting ERROR #5002... MAXSTRING errors. The problem was that most of the DTL GUI action steps only support the string data type when working with the segments. A %String has a limit of 3,641,144 characters and my OBX5.1 was 5,242,952 characters long as the example provided. Of course PACS admin stated ultra high quality up to and including 4K resolution files were needed, so we could not get the vendor to compress or reformat these files to compressed jpg or something similar.
.png)
Initially this vendor sends a 2.3 ORU^R01
I have a theory that I could use an HL7 Data Transformer in a rule without specifying a specific DocType. I want to use the same DTL for a variety of different DocTypes. Here is my very simplistic DTL so far:
Class OrdRes.TestTransform Extends Ens.DataTransformDTL [ DependsOn = EnsLib.HL7.Message ]
{
Parameter IGNOREMISSINGSOURCE = 1;
Parameter REPORTERRORS = 1;
Parameter TREATEMPTYREPEATINGFIELDASNULL = 0;
XData DTL [ XMLNamespace = "http://www.intersystems.com/dtl" ]
{
<transform sourceClass='EnsLib.HL7.Message' targetClass='EnsLib.HL7.I am trying to create a HS.FHIR.DTL.vR4.Model.Resource.Encounter message based on a conversion of HS.FHIRServer.Interop.Response QuickStream to a JSON %Dynamic Object.
When I try to send the HS.FHIR.DTL.vR4.Model.Resource.Encounter onto the Router
So, here is a novice question; but, I can't seem to figure out how to do it, or find any comments. I simply want to close out this DTL, under the Interoperability / Build / DTL screen:
.png)
There do not seem to be any buttons to 'close' the current DTL item. I tried logging off and back on, and, it brings it right back. Ideas?
I was looking for an easier way to build the FHIR Query String, given the Record Map request that is passed into the DTL.
I built this Function, but when I run a message through it, my Query String that is passed back into the DTL is a Reference Pointer and not the String I am looking for.
I have a DTL that calls a custom function that returns an object. How do I code the IF statement to check if the object is empty. e.g. IF tObject={}
Hello,
First of all thanks for your help, and thank you for your time.
We have the following task:
To generate by hand the Ens.Request with the properties and inner Data Schemes which represent this XML, in HealthShare, by hand; the XML is this one:
<DSPortal360 xmlns="http://tempuri.org/DSPortal360.I'm running into an intermittent issue with some of our Custom Operations/Processes as a result of some large FHIR R4 Binaries. Essentially we get a response from an AthenaHealth FHIR endpoint that appears to be too large to be processed using the IRIS Built In Functions for FHIR:
I've replicated it on the command line here using a file (binary.json) that has the response from the FHIR Endpoint. Not sharing full contents due to PHI concerns.
HSCUSTOM>S file=##class(%Stream.FileCharacter).%New()
HSCUSTOM>Do file.LinkToFile("/data/binary.json")
HSCUSTOM>w file.Using the FHIR DEMO, I have pieced together how to make a FHIR Request using OAuth against an External FHIR Repository. When I execute the Patient search (HS.FHIRServer.Interop.Request), I get a HS.FHIRServer.Interop.Response that has a Quick Stream ID, which I then use to convert the Quick Stream to a JSON Dynamic Object. if I do a trace on the Raw JSON Object, I am able to pull out single elements, however I want to pull the raw JSON into a defined Class Structure.
I tried using fromDao(dao As %DynamicAbstractObject) As <HS.FHIRModel.