APCDFINQ ; IHS/CMI/LAB - DATA ENTRY OPERATOR INQUIRY 3/16/93 3:11 PM ;
;;2.0;IHS PCC SUITE;;MAY 14, 2009
;
ASKPAT D GETPAT
I APCDPAT="" W !!,"No PATIENT selected!" D EOJ Q
D GETVISIT
I APCDVSIT="" W !!,"No VISIT selected!" G ASKPAT
D DSPLY W !!
D EOJ
Q
;
GETPAT ; GET PATIENT
W !
S APCDPAT=""
S DIC="^AUPNPAT(",DIC(0)="AEMQ" D ^DIC K DIC
Q:Y<0
S APCDPAT=+Y
Q
;
GETVISIT ;
S APCDLOOK="",APCDVSIT=""
K APCDVLK
D ^APCDVLK
K APCDLOOK
Q
;
DSPLY ;
;check visit with ien in APCDVSIT
W !
S Y=$P(^AUPNVSIT(APCDVSIT,0),U) X ^DD("DD") W !," Visit date/time: ",Y," [internal entry# ",APCDVSIT,"]"
S APCDDATE=$O(^APCDFORM("AB",APCDVSIT,"")) I APCDDATE="" W !," -- no posting data for that visit!" Q
S Y=$P(^APCDFORM(APCDDATE,0),U) X ^DD("DD") W !," Posting date: ",Y
S APCDMULT=$O(^APCDFORM("AB",APCDVSIT,APCDDATE,"")) I APCDMULT="" W !," -- missing form control file entry!" Q
S APCDUSR=$P(^APCDFORM(APCDDATE,11,APCDMULT,0),U,2)
W !," Data entry operator: ",$P(^VA(200,APCDUSR,0),U)
W !,"Date Last Modified: ",$$VAL^XBDIQ1(9000010,APCDVSIT,.13)
W !,"User Last Mofified: ",$$VAL^XBDIQ1(9000010,APCDVSIT,.23)
Q
;
EOJ ; EOJ HOUSE KEEPING
K %,%DT,%X,%Y,C,DIYS,X,Y
K APCDCLN,APCDCAT,APCDDATE,APCDLOC,APCDPAT,APCDVSIT,APCDLOOK,APCDTYPE,APCDMULT,APCDUSR
K AUPNPAT,AUPNDAYS,AUPNDOB,AUPNSEX,AUPNDOD
Q
APCDFINQ ; IHS/CMI/LAB - DATA ENTRY OPERATOR INQUIRY 3/16/93 3:11 PM ;
+1 ;;2.0;IHS PCC SUITE;;MAY 14, 2009
+2 ;
ASKPAT DO GETPAT
+1 IF APCDPAT=""
WRITE !!,"No PATIENT selected!"
DO EOJ
QUIT
+2 DO GETVISIT
+3 IF APCDVSIT=""
WRITE !!,"No VISIT selected!"
GOTO ASKPAT
+4 DO DSPLY
WRITE !!
+5 DO EOJ
+6 QUIT
+7 ;
GETPAT ; GET PATIENT
+1 WRITE !
+2 SET APCDPAT=""
+3 SET DIC="^AUPNPAT("
SET DIC(0)="AEMQ"
DO ^DIC
KILL DIC
+4 IF Y<0
QUIT
+5 SET APCDPAT=+Y
+6 QUIT
+7 ;
GETVISIT ;
+1 SET APCDLOOK=""
SET APCDVSIT=""
+2 KILL APCDVLK
+3 DO ^APCDVLK
+4 KILL APCDLOOK
+5 QUIT
+6 ;
DSPLY ;
+1 ;check visit with ien in APCDVSIT
+2 WRITE !
+3 SET Y=$PIECE(^AUPNVSIT(APCDVSIT,0),U)
XECUTE ^DD("DD")
WRITE !," Visit date/time: ",Y," [internal entry# ",APCDVSIT,"]"
+4 SET APCDDATE=$ORDER(^APCDFORM("AB",APCDVSIT,""))
IF APCDDATE=""
WRITE !," -- no posting data for that visit!"
QUIT
+5 SET Y=$PIECE(^APCDFORM(APCDDATE,0),U)
XECUTE ^DD("DD")
WRITE !," Posting date: ",Y
+6 SET APCDMULT=$ORDER(^APCDFORM("AB",APCDVSIT,APCDDATE,""))
IF APCDMULT=""
WRITE !," -- missing form control file entry!"
QUIT
+7 SET APCDUSR=$PIECE(^APCDFORM(APCDDATE,11,APCDMULT,0),U,2)
+8 WRITE !," Data entry operator: ",$PIECE(^VA(200,APCDUSR,0),U)
+9 WRITE !,"Date Last Modified: ",$$VAL^XBDIQ1(9000010,APCDVSIT,.13)
+10 WRITE !,"User Last Mofified: ",$$VAL^XBDIQ1(9000010,APCDVSIT,.23)
+11 QUIT
+12 ;
EOJ ; EOJ HOUSE KEEPING
+1 KILL %,%DT,%X,%Y,C,DIYS,X,Y
+2 KILL APCDCLN,APCDCAT,APCDDATE,APCDLOC,APCDPAT,APCDVSIT,APCDLOOK,APCDTYPE,APCDMULT,APCDUSR
+3 KILL AUPNPAT,AUPNDAYS,AUPNDOB,AUPNSEX,AUPNDOD
+4 QUIT