Published on InterSystems Developer Community (https://community.intersystems.com)

Home > Example DTL to extract a base64 encoded file(pdf) from an MDM^T02 OBX segment

Question
Stephen De Gabrielle · Apr 20, 2017

Example DTL to extract a base64 encoded file(pdf) from an MDM^T02 OBX segment

Hi,

Can anyone  point me to an example of a DTL & Class method that can pull a base64 encoded PDF out of a MDMT02 message?

This is really asking for two things;

- how to make a DTL that extracts a specific subfield of an HL7 2.3 message into a message of its own,

and

- how to transform an base64 encoded document into its original binary form for writing to a file.

I'd also love to see an example of an HL7 2.n MDM^T02 ==> HL73.ITK2 non-coded CDA

I've seen some snippets in the community Q&A, but I've not been able to find any examples either here, or in the documentation or training materials. 

MSH|^~\&|SystemSystem|XX|||20170315124942.0128||MDM^T02^MDM_T02|123456789||2.4
PID|1||1234567^^^MRN^MRN||Ming^Sample^^^MR||19700104000000.0000|M|||^18 Whitethorn Way^HULL^^HU8 0JF|||||||||||||||||||N
TXA||^Standard||||20170315134920|||t.tester^Test Tester|||1|c05f4f16-c886-42a0-b783-cecbe6a2e4fb|||||||||t.tester&Test Tester^20170315134938
OBX||ED|||^^Pdf^Base64^XXX|||N

Kind regards

Stephen

#DTL #HL7 #Ensemble #HealthShare

Source URL:https://community.intersystems.com/post/example-dtl-extract-base64-encoded-filepdf-mdmt02-obx-segment