HL7

Syndicate content 18 

This article will describe and include an example of how to embed an external PDF file into an HL7 segment, specifically ADT_A01:2.3.1 OBX().  This can be useful when attempting to insert pictures or other external data into an HL7 message.  In this example, the name of the PDF file to be embedded is provided in the incoming HL7 message in OBX(1):ObservationValue field.


The basic stipulations for this example are as follows:

  1. Accept a PDF file
  2. Accept an HL7 message
  3. Using the name of the PDF file, embed the PDF data into the HL7 message
  4. Output the message to file

 

 

Last comment 23 August 2017
+ 8   1 1
3429

views

+ 8

rating

DTL Transformations and GetValueAt/SetValueAt calls on HL7 messages will truncate any fields longer than 32K.  To avoid this, the methods GetFieldStreamRaw and StoreFieldStreamRaw must be used when dealing with fields that might be larger than 32K.  OBX:5 is a frequent example.  These methods have some subtleties and must be used carefully.

This can't be done by simply dragging from left to right in a DTL.  It must be done with a code action.  Also, the StoreFieldStreamRaw call must be the last edit made to the segment because the segment becomes immutable after that.

StoreFieldStreamRaw takes 3 arguments: The stream to put in the field, the VDoc path of the field in which to store the stream, and a pRemainder argument.  If the pRemainder argument isn't specified, then all fields after the field being stored are blown away.  If pRemainder is specified, then all fields after the one being stored are replaced with what's in pRemainder

Last comment 10 June 2017
+ 7   0 8
717

views

+ 7

rating

Hi everyone,

 

are you curious which topics we are going to cover at this year’s Global Summit? You have come to the right place! I will provide you with a sneak peek of what you can expect from the areas I am responsible for.

Last comment 5 September 2018
+ 5   1 3
652

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
1164

views

+ 5

rating

Hi Everyone,

Link to webinar recording: https://learning.intersystems.com/course/view.php?id=623

Thank you for your interest in this webinar!

Please submit questions about the content of the webinar as comments below this article.

The webinar covers two topics: monitoring message activity and volume and monitoring disk space. I summarize and motivate the topics in the following two sections. The information in this webinar and post applies to the Ensemble, Health Connect, and HealthShare products. For simplicity, I am only going to refer to Ensemble in this post.

1) Monitoring Message Activity and Volume:

Last comment 16 May 2017
+ 3   0 1
322

views

+ 3

rating

Framing refers to the characters that mark the start and end of an HL7 message (or other types of framed messages).  Most HL7 services and operations have a Framing setting that allows the user to define this framing.  The most common choices are available as defaults, but with the AsciiMM/NN setting, components can be configured to recognize any framing characters.

The most common framing error is ErrEndBlock.  Other typical errors include a warning saying "Discarding received non-HL7 data", a warning saying "Returning unused unexpected n-char segment", and "Discarding leftover input ''".

These errors will usually report what character was expected and which character was missing or unexpected.  For non-printing characters, it will report these using a mapping to printing characters as in the following table

+ 2   0 2
0

comments

567

views

+ 2

rating

We are interfacing through Ensemble with an application that does not like diacritic signs in text. I have been searching for a way to strip these signs from the HL7 messages that get send to that application. 
The problem in short is we have an incoming HL7 message with e.g. é (or ë, á etc), this goes into Ensemble. In the outgoing message the é should be replaced with an e. 

I have tried solving this issue with the use of a new subtable, which does the conversion as é->e / ë->e etc. This works with (file)streams and also with ZConvert: Write $Zconvert("ë","O","BASCII")outputs "e", where BASCII is the new subtable. I have not found an easy way to use this subtable in Ensemble to strip the diacritic signs from the message. 

What (other) options are available?
 

Last answer 11 October 2016
+ 2   0 1
0

comments

158

views

+ 2

rating

EnsLib.HL7.Message.cls provides many API methods for manipulating an HL7 message.  RemoveSegmentAt(), for example, can be used to remove a segment by path or index, but only one segment at a time.   There may be times that you'll need to remove all segments within a group or even many groups of segments from the HL7 message.  Surely you can iterate through each segment in each group and remove them one by one, but there's a much easier way. 

 

With just one command, like below, you can remove all OBX segments in an ORU_R01 message (msg):

Set tSC = msg.SetValueAt(,"PIDgrpgrp(1).ORCgrp(1).OBXgrp()","remove")

 

Or, with just the following command, you can easily remove all PR1 and ROL segments within a specific group in an ADT_A01 message (msg)

Last comment 14 November 2018
+ 2   0 2
778

views

+ 2

rating

I see the TS and DT data types in the default 2.3 schema:

<DataType name='TS' description='time stamp'>
    <DataSubType piece='1' description='time of an event' datatype='ST'/>
    <DataSubType piece='2' description='degree of precision' datatype='ST'/>
</DataType>

<DataType name='DT' description='Date (2.8.13)'>
    <DataSubType piece='1' description='Date (2.8.13)'/>
</DataType>

but it doesn't appear that it would actually validate the format. Is this possible? We had an instance recently where a customer was sending a timestamp with a missing digit (20160503120 for example). I would like to validate this with the schema if I can.

Last answer 25 August 2016 Last comment 11 October 2016
+ 1   0 1
516

views

+ 1

rating

This is a sample Ensemble/Health Connect production which demonstrates how to receive an HL7 order (ORM) inbound from a file, extract fields (in this case, basic demographic information), and insert those into a table in an external SQL database via ODBC.  

Included in the zip file:

  • Exported code
  • Sample ORM message
  • 'How to configure' doc 
Last comment 19 April 2018
+ 1   0 3
865

views

+ 1

rating

Hi all,

We have a big problem with spanish accent and special characters using Data Transformation (HL7 Messages).

We have some DT to transform HL7 messages to other type (OUL^R22 To OML^O21) so it copys the PID segment to the new one, but if in the PatienName field has any special character, the transformation stops and it not continues with the transformation.

This is the message
 

MSH|^~\&|B11111111|000000000C|LAB|TSFLAB|20170117163714||OUL^R22|ID1||2.5||||||UTF-8 
PID|1|1234567890134567890|00000000R||MUÑOZ LÓPEZ^JUAN^||19900101000000||||&||
OBR|1|23145687456894561321|23141211||||||
ORC|RS||4385025|||||||||

 

The transformation changes the "Ñ" and the "Ó" to "?", however if I'm using a personal structure based on HL7 2.5, the transformation doesn't work and the test page gets stuck

Last answer 25 January 2017
0   0 0
0

comments

338

views

0

rating

What is the recommended approach to handle the following scenario: Large number of HL7 messages are serviced via Ensemble. Those messages are then transformed and routed to an Operation which calls a web service which does a number of different activities. If will do address normalization, location geo coding, MPI lookup and resolution, and insert into a SQL Server database to stage for an analytics product. Unfortunately all of this work takes time and the first thing that happens in the web service is a lock taken out on the Patien in SQL Server. Each call can take seconds where the message input is taking milliseconds. This starts to impact the operation queue as the soap calls can be blocked by the locks. The Ensemble operation is waiting on the web service to return.

Last comment 4 March 2016
+ 1   0 5
0

answers

380

views

+ 1

rating

The InterSystems FHIR® Sandbox is a virtual testing environment that combines HealthShare technology with synthetic patient data and open source and commercial SMART on FHIR apps, to allow users to play with FHIR functionality.

The sandbox is designed to enable developers and innovators to connect and test their own DSTU2 apps to multi-source health records hosted by the latest version of HealthShare.   Share your experience with others or ask questions here in the FHIR Implementers Group

Click here to access the InterSystems FHIR® Sandbox.

+ 1   0 1
0

comments

315

views

+ 1

rating

Hello Greetings-

I am exploring on converting HL7 to FHIR.

1. I saw there are built in DTLs “FHIR.FromSDA” and “FHIR.ToSDA” to convert SDA -> FHIR and FHIR -> SDA. Similarly Do Intersystems have DTLs for HL7 -> FHIR and FHIR -> HL7?

2. The reason why I am asking is, I see in HSLIB namespace HS->GateWay->HL7->HL7toSDA3 and HS->GateWay->SDA3->SDA3toHL7 DTLs. Like-wise I am trying to locate HL7 -> FHIR and FHIR -> HL7. Please help me to locate them

3. If there are no built-in DTLs for converting HL7 -> FHIR and FHIR -> HL7, what is the process to achieve this?

 

Thanks much in-advance.

Thanks,

Surya

Last answer 22 March 2017 Last comment 14 August 2017
+ 1   1 2
864

views

+ 1

rating

I have a tool I absolutely love for HL7 v2 analysis and manipulation. It's called 7edit.  I'm wondering if there is anything similar for HL7v3/CDA/CCD.  I know it is considerably more complex, but I still have hope.

So far the best resource I've found is http://www.cdapro.com/.  I'd love to hear anyone else's tips for tools or resources.

Last answer 31 May 2016
+ 1   0 1
0

comments

654

views

+ 1

rating

I want to test automatically that HL7 business operation works correctly in error conditions. One is to test CE acknowledgement. I have planned to implement test production which includes business services for different situations (AA, AE, CA, CE, timeout, late response etc).

How should I implement HL7 business service that always returns CE (commit error)? I have tried but it keeps returning "AA".

Last answer 19 December 2018
+ 1   0 3
0

comments

98

views

+ 1

rating

For testing purposes, I would like to create an EnsLib.HL7.Message from either a %String or a file on disk and pass it into a function in a unit test (outside of an Ensemble context). EnsLib.HL7.Parser appears to do the necessary parsing, but it also sends the message via Ensemble service rather than returning it as a value. Is there a way to leverage the parsing outside of a Ensemble service? Alternatively, is there another way to create an EnsLib.HL7.Message?

Last answer 15 December 2016
+ 1   0 3
0

comments

835

views

+ 1

rating

I have an interface that does not send me specific ID's, so I am scanning the AIL3.2 (Text) field for certain characters. The Routing rule is getting pretty big with all the OR statements. Is there a way that I can define what I am searching for in the data lookup table, and not have to scan the whole field that it does by default? Is there a way that I can simplify this

Last answer 18 January 2018 Last comment 18 January 2018
0   0 2
241

views

0

rating

Hi, 

I want to splice a PID segement returned from a query, so I can use it in a DTL:

<assign value='context.pidSegment' property='target.{PIDgrp.PID}' action='set' />

I need to set the value of 'context.pidSegment' to something I can use in the DTL objectscript expression

but I'm not sure what method (or property) to use to get the class EnsLib.HL7.Segment segment into a datatype that can be used in the DTL?

I've tried the following to no avail

Last answer 11 June 2018
0   0 1
0

comments

128

views

0

rating

Is there any good documentation/tutorials on creating gateways in both directions between FHIR and Hl7v2 (for Health Connect)?

the scenarios I'm most interested in

1. Client application sends a FHIR demographic query to Health Connect - and the interface has to convert this to Hl7v2 QBP^Q11 message to the PAS.

2. Health connect sends a PDF document (from a file or HL7v2 interface) to an EPR over FHIR.

Thanks

Stephen

UPDATE

We are using Health Connect  15.03 - Cache for Windows (x86-64) 2017.2.1 (Build 801U) Wed Dec 6 2017 09:07:51 EST [HealthShare Modules:Core:15.03.9901 + Linkage Engine:15.03.9901]

There hasn't been a HealthShare Connect release on HS Core 16.

Last answer 3 January 2019 Last comment 7 January 2019
0   1 3
220

views

0

rating

Hello,

currently we have a problem in development with the character set of the response message.

We are transmitting an HL7 message with an operation based on the EnsLib.HL7.Operation.HTTPOperation class.
We have changed this as follows.

Set pMsgIn=$$$NULLOREF, tHttpRequest=##class(%Net.HttpRequest).%New(), tHttpRequest.WriteRawMode=1, tHttpRequest.ContentType="APPLICATION/HL7-V2; charset=UTF-8"

Unfortunately, the ContentType character set is not read correctly in the response.

 

This is the response

Last comment 8 days ago
0   0 2
0

answers

40

views

0

rating

Hi all,

I'm trying to convert a HL7 section to a XML or JSON string.

We need to save the content of PID section into a SQL Column, therefore we need to convert it into a XML o JSON string

is there any easy way to convert it?

I've tried to convert it directly into a DTL, but all my attempts have been unsuccessful

Best regards,

Francisco Lopez

Last answer 22 December 2016 Last comment 20 December 2016
0   0 0
490

views

0

rating