APCDEWHO ; IHS/CMI/LAB - DISPLAY PATIENT & VISIT INFO ;
;;2.0;IHS PCC SUITE;;MAY 14, 2009
;CALLED FROM THE TEMPLATE APCD WHO (WHO)
;
START(APCDEV) ;EP - CALLED FROM EHR CODING AUDIT
NEW APCDVREC
S:$G(APCDEV) APCDVREC=^AUPNVSIT(APCDEV,0)
W !!,"You are currently processing the following Patient",$S($G(APCDEV):" Visit",1:""),":",!!
S APCDH="Patient Name",APCDV=$E($P(^DPT(AUPNPAT,0),U),1,20) D WRITE
S APCDH="Chart #",APCDV=$S($D(^AUPNPAT(AUPNPAT,41,DUZ(2),0)):$P(^(0),U,2),1:"None") D WRITE
S APCDH="Date of Birth" S Y=AUPNDOB D DD^%DT S APCDV=Y D WRITE
S APCDH="Sex",APCDV=AUPNSEX D WRITE
G:'$D(APCDVREC) XIT
S APCDH="Visit Date" S Y=$P(APCDVREC,U) D DD^%DT S APCDV=Y D WRITE
S APCDH="Location",APCDV=$E($P(^DIC(4,$P(APCDVREC,U,6),0),U),1,25) D WRITE
S APCDH="Type",APCDV=$P(APCDVREC,U,3) D WRITE
S APCDH="Service Category",APCDV=$P(APCDVREC,U,7) D WRITE
S APCDH="Clinic",APCDV=$S($P(APCDVREC,U,8)="":"None Entered",1:$P(^DIC(40.7,$P(APCDVREC,U,8),0),U)) D WRITE
S APCDH="Hospital Location",APCDV=$$VAL^XBDIQ1(9000010,APCDEV,.22) D WRITE
S APCDH="Chart Audit Status",APCDV=$$VAL^XBDIQ1(9000010,APCDEV,1111) D WRITE
S APCDH="Dependent Entry Count",APCDV=$P(APCDVREC,U,9) D WRITE
;
XIT ;
W !
K APCDY,Y,APCDX,APCDT,APCDV,APCDH,APCDZ,APCDVREC
Q
WRITE ;
S APCDX=APCDH_": "_APCDV W:$X>39 ! S APCDT=$S($X>1:41,1:1) W:(APCDT+$L(APCDX))>79 ! W ?APCDT,APCDH,": ",@APCDRVON,APCDV,@APCDRVOF
K APCDT,APCDX
Q
APCDEWHO ; IHS/CMI/LAB - DISPLAY PATIENT & VISIT INFO ;
+1 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
+2 ;CALLED FROM THE TEMPLATE APCD WHO (WHO)
+3 ;
START(APCDEV) ;EP - CALLED FROM EHR CODING AUDIT
+1 NEW APCDVREC
+2 IF $GET(APCDEV)
SET APCDVREC=^AUPNVSIT(APCDEV,0)
+3 WRITE !!,"You are currently processing the following Patient",$SELECT($GET(APCDEV):" Visit",1:""),":",!!
+4 SET APCDH="Patient Name"
SET APCDV=$EXTRACT($PIECE(^DPT(AUPNPAT,0),U),1,20)
DO WRITE
+5 SET APCDH="Chart #"
SET APCDV=$SELECT($DATA(^AUPNPAT(AUPNPAT,41,DUZ(2),0)):$PIECE(^(0),U,2),1:"None")
DO WRITE
+6 SET APCDH="Date of Birth"
SET Y=AUPNDOB
DO DD^%DT
SET APCDV=Y
DO WRITE
+7 SET APCDH="Sex"
SET APCDV=AUPNSEX
DO WRITE
+8 IF '$DATA(APCDVREC)
GOTO XIT
+9 SET APCDH="Visit Date"
SET Y=$PIECE(APCDVREC,U)
DO DD^%DT
SET APCDV=Y
DO WRITE
+10 SET APCDH="Location"
SET APCDV=$EXTRACT($PIECE(^DIC(4,$PIECE(APCDVREC,U,6),0),U),1,25)
DO WRITE
+11 SET APCDH="Type"
SET APCDV=$PIECE(APCDVREC,U,3)
DO WRITE
+12 SET APCDH="Service Category"
SET APCDV=$PIECE(APCDVREC,U,7)
DO WRITE
+13 SET APCDH="Clinic"
SET APCDV=$SELECT($PIECE(APCDVREC,U,8)="":"None Entered",1:$PIECE(^DIC(40.7,$PIECE(APCDVREC,U,8),0),U))
DO WRITE
+14 SET APCDH="Hospital Location"
SET APCDV=$$VAL^XBDIQ1(9000010,APCDEV,.22)
DO WRITE
+15 SET APCDH="Chart Audit Status"
SET APCDV=$$VAL^XBDIQ1(9000010,APCDEV,1111)
DO WRITE
+16 SET APCDH="Dependent Entry Count"
SET APCDV=$PIECE(APCDVREC,U,9)
DO WRITE
+17 ;
XIT ;
+1 WRITE !
+2 KILL APCDY,Y,APCDX,APCDT,APCDV,APCDH,APCDZ,APCDVREC
+3 QUIT
WRITE ;
+1 SET APCDX=APCDH_": "_APCDV
IF $X>39
WRITE !
SET APCDT=$SELECT($X>1:41,1:1)
IF (APCDT+$LENGTH(APCDX))>79
WRITE !
WRITE ?APCDT,APCDH,": ",@APCDRVON,APCDV,@APCDRVOF
+2 KILL APCDT,APCDX
+3 QUIT