Thanikachalam Rajuudayar

Forum Replies Created

Viewing 4 replies – 1 through 4 (of 4 total)
  • Author
    Replies
  • in reply to: TCL help – to print including space characters #84897

    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]

    in reply to: TCL help – to print including space characters #84895

    It is working now. Thanks Charlie.

    in reply to: TCL help – to print including space characters #84894

    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

    in reply to: TCL help – to print including space characters #84892

    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

Viewing 4 replies – 1 through 4 (of 4 total)