- This topic has 4 replies, 3 voices, and was last updated 15 years, 7 months ago by .
-
Topic
-
Hi Everyone, I am looking for some help to pattern match a string and extract accession number from a HL7 message.
My message looks like this:
MSH|^~&|RAD|UCHC|||200903111204||ORU|RMS|P|2.3||
PID|1|000T99000789|000009002872|000000014701|TEST^JAPAN^^^||196604050000|F|
PV1||O|IC2^IC2^^UCHC||||008033^MANGER MD^THOMAS M^|008320^MENOUTIS MD^JOHN|^^|ORA|||||N^N^U||008033^MANGER MD^THOMAS M^||000000014701||||||||||||||||||||UCHC|
OBR||00001 ^001 |100114|ULT4280033 ^US ABDOMEN COMPLETE |||200903101042|||DMC|||||^^^ |008033^THOMAS M MANGER MD||||||200903111204|||||1^^^^^R^^ROUTINE|||||999991&DEFAULT&DOCTOR&&&|
NTE|||Test change prelim then final
OBX|1|TX|ULT0033GDT||ULTRASOUND REPORT~***Final Report***~~ULT 0033 – US ABDOMEN COMPLETE
(A#:100114,03/10/2009)~INDICATIONS: Test change prelim then final~~RESULT: ~The liver is normal in size and echogenicity. I am searching for (A#: and the next set of numbers before the comma is the accession number that I need to pull out.
This is what I have so far:
set msgHeader [string range $msg 0 8]
set msgTail [string range $msg 9 end]
regexp {[(A#:]} $msgTail match x
echo “Accession” $x
Thanks,
Alka…
- The forum ‘Cloverleaf’ is closed to new topics and replies.