question

Monika avatar image
Monika asked

How to separate segments in HL7

I have a one Complete HL7 data in single Column in SQL SERVER table,

I want to read SQL QUERY from that single to populate all the HL7 segments as separate columns in Notepad++

Can anyone please assist me on it?


Example: MSH|^~\&|CPSI|FLOYD CHEROKEE MEDIC^1396766267^NPI|BioSense|ADPH^2.16.840.1.113883.3.1673^ISO|20220805231756-0500||ADT^A01^ADT_A01|2022080523175673|P|2.5.1|||NE||||||PH_SS-NoAck^SS Sender^2.16.840.1.114222.4.10.3^ISO EVN||20220805111756.20|||||FLOYD CHEROKEE MEDIC^1396766267^NPI PID|1||00042016^^^FLOYD CHEROKEE MEDIC&1396766267&NPI^PN^~215490^^^FLOYD CHEROKEE MEDIC&1396766267&NPI^MR^~40077288^^^FLOYD CHEROKEE MEDIC&1396766267&NPI^VN^||CALJKUSICH^MICHAEL^S^^^^L||19561208|M||2106-3^White^CDCREC|8825 COUNTY ROAD 19^^PIEDMONT^01^362724446^USA^C^CALHOUN^01015||^PRN^PH^^1^256^2426361|||||40077288^^^^AN||||2186-5^Not Hispanic or Latino^CDCREC PV1|1|E|015^ED^03|E||||||ER||||01|||||40077288^^^FLOYD CHEROKEE MEDIC&1396766267&NPI^VN^|||||||||||||||||||||||||20220805231700-0500| OBX|1|XAD|SS002^TREATING FACILITY LOCATION^PHINQUESTION||400 NORTHWOOD DR^^CENTRE^AL^359601023^USA^C^^01000||||||F OBX|2|CWE|SS003^^PHINQUESTION|^FACILITY/VISIT TYPE|261QE0002X^Emergency Care^NUCC||||||F OBX|3|NM|21612-7^AGE - REPORTED^LN||65|a^YEAR^UCUM|||||F OBX|4|TX|8661-1^Chief Complaint^LN||CHEST PAIN||||||F

data
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

anthony.green avatar image anthony.green commented ·
What is the end result set here?

Does the data split on the | or on the ^?

Is there any documentation on the HL7 field list and how to interrogate it?

0 Likes 0 ·

1 Answer

·
Monika avatar image
Monika answered

My concern was resolved.

Question: How to add Carriage Returns and Line Breaks in my HL7 message while I'm copy/paste the message from/in Microsoft SQL Server?

Solution: In Microsoft SQL Server: Go to Tools / Options / Query Results / SQL Server / Results to Grid

On right side you can see a "check box with Retain CR/LF on copy or save" -> we need to check this box so whenever we copy HL7 messages/any script messages and paste them in Notepad++ or any we can see the message with break into its respective segments.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.