Changeset 260
- Timestamp:
- Nov 4, 2008, 1:10:49 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ccr/trunk/p/GPLLABS.m
r255 r260 38 38 LIST ; LIST THE HL7 MESSAGE 39 39 ; 40 ; N C0CI,C0CJ,C0COBT,C0CHB 40 ; N C0CI,C0CJ,C0COBT,C0CHB,C0CVAR 41 41 ; D EXTRACT^GPLLABS(,1,) 42 42 S C0CTAB=$NA(^KBAI) ; BASE OF OBX TABLE … … 44 44 S C0CI="" 45 45 F S C0CI=$O(@C0CHB@(C0CI)) Q:C0CI="" D ; FOR ALL RECORDS IN HL7 MSG 46 . K C0CVAR,XV ; CLEAR OUT VARIABLE VALUES 46 47 . S C0CTYP=$P(@C0CHB@(C0CI),"|",1) 47 . D LTYP(@C0CHB@(C0CI),C0CTYP) 48 . D LTYP(@C0CHB@(C0CI),C0CTYP,.C0CVAR) 49 . M XV=C0CVAR ; 50 . I C0CTYP="OBX" D ; SPECIAL CASE FOR OBX3 51 . . ; RESULTTESTCODEVALUE 52 . . ; RESULTTESTDESCRIPTIONTEXT 53 . . I C0CVAR("C3")="LN" D ; PRIMARY CODE IS LOINC 54 . . . S XV("RESULTTESTCODEVALUE")=C0CVAR("C1") ; THE LOINC CODE VALUE 55 . . . S XV("RESULTTESTCODINGSYSTEM")="LOINC" ; DISPLAY NAME FOR LOINC 56 . . . S XV("RESULTTESTDESCRIPTIONTEXT")=C0CVAR("C2") ; DESCRIPTION TEXT 57 . . E I C0CVAR("C6")="LN" D ; SECONDARY CODE IS LOINC 58 . . . S XV("RESULTTESTCODEVALUE")=C0CVAR("C4") ; THE LOINC CODE VALUE 59 . . . S XV("RESULTTESTCODINGSYSTEM")="LOINC" ; DISPLAY NAME FOR LOINC 60 . . . S XV("RESULTTESTDESCRIPTIONTEXT")=C0CVAR("C5") ; DESCRIPTION TEXT 61 . . E I C0CVAR("C6")'="" D ; NO LOINC CODES, USE SECONDARY IF PRESENT 62 . . . S XV("RESULTTESTCODEVALUE")=C0CVAR("C4") ; SECONDARY CODE VALUE 63 . . . S XV("RESULTTESTCODINGSYSTEM")=C0CVAR("C6") ; SECONDARY CODE NAME 64 . . . S XV("RESULTTESTDESCRIPTIONTEXT")=C0CVAR("C5") ; SECONDARY TEXT 65 . . E D ; NO SECONDARY, USE PRIMARY 66 . . . S XV("RESULTTESTCODEVALUE")=C0CVAR("C1") ; PRIMARY CODE VALUE 67 . . . S XV("RESULTTESTCODINGSYSTEM")=C0CVAR("C3") ; PRIMARY DISPLAY NAME 68 . . . S XV("RESULTTESTDESCRIPTIONTEXT")=C0CVAR("C2") ; USE PRIMARY TEXT 69 . . ZWR XV 48 70 . W C0CI," ",C0CTYP,! 49 71 . ; S C0CI=$O(@C0CHB@(C0CI)) 50 72 Q 51 LTYP(OSEG,OTYP ) ;73 LTYP(OSEG,OTYP,OVARA) ; 52 74 S OTAB=$NA(@C0CTAB@(OTYP)) ; TABLE FOR SEGMENT TYPE 53 75 I 1 D ; FOR HL7 SEGMENT TYPE … … 60 82 . . . S OI2=$P(OTI,";",2) ; THE SUB-INDEX 61 83 . . . S OV=$P(OV,"^",OI2) ; PULL OUT SUB-VALUE 84 . . S OVARA(OVAR)=OV ; PASS BACK VARIABLE AND VALUE 62 85 . . I OV'="" W OI_": "_$P(@OTAB@(OI),"^",3),": ",OVAR,": ",OV,! 63 86 Q … … 168 191 S X("OBX","OBX2")="2^00676^Value Type" 169 192 S X("OBX","OBX3")="3^00560^Observation Identifier" 170 S X("OBX","OBX3;LOINC")="3;4^00560^Observation Identifier^RESULTTESTCODEVALUE" 171 S X("OBX","OBX3;DESC")="3;5^00560^Observation Identifier^RESULTTESTDESCRIPTIONTEXT" 172 S X("OBX","OBX3;VACODE")="3;6^00560^Observation Identifier" 193 S X("OBX","OBX3;C1")="3;1^00560^Observation Identifier^C1" 194 S X("OBX","OBX3;C2")="3;2^00560^Observation Identifier^C2" 195 S X("OBX","OBX3;C3")="3;3^00560^Observation Identifier^C3" 196 S X("OBX","OBX3;C4")="3;4^00560^Observation Identifier^C4" 197 S X("OBX","OBX3;C5")="3;5^00560^Observation Identifier^C5" 198 S X("OBX","OBX3;C6")="3;6^00560^Observation Identifier^C6" 173 199 S X("OBX","OBX4")="4^00769^Observation Sub-Id" 174 200 S X("OBX","OBX5")="5^00561^Observation Results^RESULTTESTVALUE" 175 201 S X("OBX","OBX6")="6^00562^Units^RESULTTESTUNITS" 176 S X("OBX","OBX7")="7^00563^Reference Range^ "202 S X("OBX","OBX7")="7^00563^Reference Range^RESULTTESTNORMALDESCRIPTIONTEXT" 177 203 S X("OBX","OBX8")="8^00564^Abnormal Flags" 178 204 S X("OBX","OBX9")="9^00639^Probability"
Note:
See TracChangeset
for help on using the changeset viewer.