Hello,

This example shows an "HL7 to Batch File" example where the header contains "dynamic" information; in this case the total number of rows in the batch file is included in the header (using the same technique we could place this info in the trailer as well).  To accomplish this you simply (1) subclass the batch class and use COS to provide the logic for the dynamic fields in the header and trailer and then (2) configure the "DelayDefaultBatchOutput" setting on the batch operation to "TRUE" so that the batch header will not be written out to a temp file before all the records contained within the batch are available to the operation.

With that, attached is a code export of a sample production (and related files) that takes in a file with several HL7 messages and then writes some of the data contained in each message out as a batch file with a header and trailer

0   0 1
0

comments

191

views

0

rating

Hello,

We are sometimes asked for examples of how to do 3rd party SQL database selects/updates/inserts/stored procedures from an Ensemble SQL Business Operation.

In the attached file there are 4 sample Ensemble Operations that demonstrate four different types of transactions with an external SQL DB:

1:  The "CheckExists" shows how to use an Operation to do a select statement to see if a given patient MRN exists in a DB
2:  The ExecSP Operation shows how to execute a stored procedure from a BO
3:  the Update Operation does an Update
4:  the Insert Operation does an Insert

Given the samples, one can combine updates/inserts/SPs/selects into a single operation as needed.

 

ensemble_sql_operation_examples_0.zip

Last comment 8 June 2016
+ 5   0 4
1011

views

+ 5

rating

Two fairly common requests we receive from HL7 customers are (1) how to remove all trailing delimiters for fields and segments in HL7 messages and (2) how to "find and replace" for an entire HL7 message (as opposed to one segment/field at a time).  The code sample below shows a custom function that solves for item 1 and by extension item 2 above.  In other words the same approach can be used for finding/replacing any sequence of chars in an entire HL7 message, with some tweaks to the custom function.

Here’s an example of how to actually call the function from DTL.  I recommend doing this as the last line of code in any DTL where it is used.  Note that “target” is used in both the value and property of the code below (as opposed to the DTL “source” message).

<assign value='##class(ISCSample.Custom.Function.ConversionScrub).ConversionScrub(target)' property='target' action='set' />

 

Here's the  sample class and classmethod:

Last comment 16 May 2018
+ 5   0 5
1218

views

+ 5

rating