APCDDLAB ; IHS/CMI/LAB - DISPLAY EXISTING LAB DATA FOR VISIT ;
;;2.0;IHS PCC SUITE;;MAY 14, 2009
;
;called from data entry input templates
;APCDVSIT must = visit dfn
;
START ;
I '$D(^AUPNVLAB("AD",APCDVSIT)) W !!?18,"No Lab Tests currently entered for this visit.",! Q
W !!?18,"CURRENT LAB TESTS AND RESULTS FOR THIS VISIT",!,"Visit Date: " S Y=APCDDATE D DD^%DT W Y W ?35,"Patient Name: ",$P(^DPT(AUPNPAT,0),U)
S APCDDLAB("X")=0 F S APCDDLAB("X")=$O(^AUPNVLAB("AD",APCDVSIT,APCDDLAB("X"))) Q:APCDDLAB("X")="" D
. W !,$P(^LAB(60,$P(^AUPNVLAB(APCDDLAB("X"),0),U),0),U),?35,$P(^AUPNVLAB(APCDDLAB("X"),0),U,4)
. Q
K APCDDLAB,Y
Q
APCDDLAB ; IHS/CMI/LAB - DISPLAY EXISTING LAB DATA FOR VISIT ;
+1 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
+2 ;
+3 ;called from data entry input templates
+4 ;APCDVSIT must = visit dfn
+5 ;
START ;
+1 IF '$DATA(^AUPNVLAB("AD",APCDVSIT))
WRITE !!?18,"No Lab Tests currently entered for this visit.",!
QUIT
+2 WRITE !!?18,"CURRENT LAB TESTS AND RESULTS FOR THIS VISIT",!,"Visit Date: "
SET Y=APCDDATE
DO DD^%DT
WRITE Y
WRITE ?35,"Patient Name: ",$PIECE(^DPT(AUPNPAT,0),U)
+3 SET APCDDLAB("X")=0
FOR
SET APCDDLAB("X")=$ORDER(^AUPNVLAB("AD",APCDVSIT,APCDDLAB("X")))
IF APCDDLAB("X")=""
QUIT
Begin DoDot:1
+4 WRITE !,$PIECE(^LAB(60,$PIECE(^AUPNVLAB(APCDDLAB("X"),0),U),0),U),?35,$PIECE(^AUPNVLAB(APCDDLAB("X"),0),U,4)
+5 QUIT
End DoDot:1
+6 KILL APCDDLAB,Y
+7 QUIT