source: WorldVistAEHR/trunk/r/ICR_IMMUNOLOGY_CASE_REGISTRY-IMR/IMRTST.m@ 623

Last change on this file since 623 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.3 KB
Line 
1IMRTST ;HCIOFO/FAI-LOOKUP LAB TEST VALUES (HIV ANTIBODY);07/11/00 11:21;
2 ;;2.1;IMMUNOLOGY CASE REGISTRY;**9,5**;Feb 09, 1998
3 ; called from IMRCD4 routine
4TYPE ; Entry with IMRDFN defined and pointers for local lab test name & NLT
5 K ^TMP($J)
6 D HEAD,DATA,SORT
7 K ^TMP($J)
8 Q
9DATA K IMRCD
10 I $G(IMRTSTLR)="" W !!,?13,"** SORRY NO LABORATORY REFERENCE IN PLACE **" Q
11 S (IMRTSTI,IMRTSTII)="",ILR=IMRTSTLR
12 S LGN="" F S LGN=$O(^IMR(158.95,"B",LGN)),LIG="" Q:LGN="" S LIG=$O(^IMR(158.95,"B",LGN,LIG)) Q:LIG="" D LOCAL
13 Q
14LOCAL Q:LGN'="HIV ANTIBODY"
15 S IMRCD="" F S IMRCD=$O(^IMR(158.9,1,3,"B",LIG,IMRCD)),IMS="" Q:IMRCD="" F S IMS=$O(^IMR(158.9,1,3,IMRCD,1,"B",IMS)),IMLM="" Q:IMS="" F S IMLM=$O(^IMR(158.9,1,3,IMRCD,1,"B",IMS,IMLM)) Q:IMLM="" D LLT
16 Q
17LLT S IMLO="" F S IMLO=$O(^IMR(158.9,1,3,IMRCD,1,IMLM,1,"B",IMLO)),TNN="" Q:IMLO="" F S TNN=$O(^IMR(158.9,1,3,IMRCD,1,IMLM,1,"B",IMLO,TNN)) Q:TNN="" D LWK
18 Q
19LWK S IMWK=$P($G(^IMR(158.9,1,3,IMRCD,1,IMLM,1,TNN,0)),U,2),LNM=$P($G(^LAB(60,IMLO,0)),U,1),LLOC=$P($G(^LAB(60,IMLO,0)),U,5)
20 I LLOC'="" S UNN=$P($G(^LAB(60,IMLO,1,0)),U,3),LDAT=$P(LLOC,";",2) S:UNN'="" UNS=$P($G(^LAB(60,IMLO,1,UNN,0)),U,7) D CHEMS Q
21 I LLOC="" D PANEL Q
22 Q
23PANEL F PN=0:0 S PN=$O(^LAB(60,IMLO,2,PN)) Q:PN'>0 S LPN=$P($G(^LAB(60,IMLO,2,PN,0)),U,1),LNM=$P($G(^LAB(60,LPN,0)),U,1),LLOC=$P($G(^LAB(60,LPN,0)),U,5) D PAN2
24 Q
25PAN2 S UNN=$P($G(^LAB(60,LPN,1,0)),U,3)
26 S:UNN'="" UNS=$P($G(^LAB(60,LPN,1,UNN,0)),U,7)
27 S:LLOC'="" LDAT=$P(LLOC,";",2)
28 D CHEMS
29 Q
30CHEMS S LDT="" F S LDT=$O(^LR(ILR,"CH",LDT)),DNAM="" Q:LDT="" F S DNAM=$O(^LR(ILR,"CH",LDT,DNAM)) Q:DNAM="" S LRES=$P($G(^LR(ILR,"CH",LDT,LDAT)),U,1),DTRC=$P($G(^LR(ILR,"CH",LDT,0)),U,1),Y=DTRC D DD^%DT S (DTAA,DTRC)=Y D PLBS
31 Q
32PLBS Q:(LRES["CANC")!(LRES["canc")
33 Q:(DTRC["CANC")!(DTRC["canc")
34 S DTR1=$E(DTAA,1,3),DTR2=$E(DTAA,9,12),DTRD=DTR1_","_DTR2
35 S DTRC=$E(DTRC,1,12),LDO=$E(LDT,1,7)
36 Q:DNAM'=LDAT S ^TMP($J,LDO,LNM)="HIV_ANTIBODY"_U_UNS_U_LRES_U_DTRC
37 Q
38HEAD W !!!,?20,"Western Blot and Elisa Values",!!,?3,"DATE",?18,"RESULT",?32,"TEST"
39 W !,?3,"----",?18,"---------",?33,"------"
40 Q
41SORT I '$D(^TMP($J)) W !!,?20,"** NO DATA FOUND **" Q
42 S MDT="" F S MDT=$O(^TMP($J,MDT)),LNM="" Q:MDT="" F S LNM=$O(^TMP($J,MDT,LNM)) Q:LNM="" S RC=^TMP($J,MDT,LNM),UNS=$P(RC,U,2),RES=$P(RC,U,3),IMDATE=$P(RC,U,4) W !,IMDATE,?18,RES,?33,LNM
43 Q
Note: See TracBrowser for help on using the repository browser.