Forum Replies Created
-
AuthorReplies
-
Here is the working code to display PV1-3 and OBR-4.2. As you suggested, it worked after I split the message into list of segments. Thank you so much for your help Charlie.
set mh [keylget args MSGID] ;#Message header
set msg [msgget $mh]
set segs [split $msg r] ;# List of segments
set msh [lindex $segs 0] ;# MSH segment
set fldsep [string index $msh 3] ;# Field sep (|)
set subsep [string index $msh 4] ;# Subfield sep (^)
#get PV1-3 Location
set pv1idx [lsearch -regexp $segs ^PV1]
set pv1flds [split [lindex $segs $pv1idx] $fldsep
set patientLoc [lindex $pv1flds 3]
echo PV1-3 Location : $patientLoc
#get OBR-4.2 Test Description
set obridx [lsearch -regexp $segs ^OBR]
set obrflds [split [lindex $segs $obridx] $fldsep]
set testDesc [lindex [split [lindex $obrflds 4] $subsep 1]
echo OBR-4.2 Test Description : $testDesc
HL7 field Field content Displayed as
PV1-3 Family Care Center Family Care Center
OBR-4.2 DRUG SCREEN 10 DRUG SCREEN 10
[/b]
It is working now. Thanks Charlie.
No, it is not working. It displayed DRUG instead of DRUG SCREEN 10 for OBR-4.2. and just “Family” instead of “Family Care Center”. It displays properly if I remove the space between words. Thanks Charlie.
HL7 field Field content Displayed as
PV1-3 Family Care Center Family
PV1-3 FamilyCareCenter FamilyCareCenter <– This one works because there is no space
OBR-4.2 DRUG SCREEN 10 DRUG
Hi Charlie,
Thanks for pointing out the typo. The “:” was a typo when I posted it. Yes, I executed the code on a different PC where I have access to Cloverleaf GUI. For some reason, it does not display the total content from the HL7 field PV1-3. I tried to display the value from a different field OBR-4.2 Universal Service ID Description, and it also displays only “DRUG” with the string length as 4. Thanks
OBR-4 = 12345^DRUG SCREEN 10^12345
-
AuthorReplies