ADENODE ; IHS/HQT/MJL - RESET PATIENT UPDATE FLAG ; [ 03/24/1999 9:04 AM ]
;;6.0;ADE;;APRIL 1999
;IHS/HMW 5-5-92 Now checks ADEPOST & returns message if unposted data
;exists in the queue.
;------->INIT
S U="^"
;------->LOOKUP PT
S DIC="^AUPNPAT(",DIC(0)="AEMQZ" D ^DIC G:Y<1 END S ADEPAT=+Y
;------->CHECK FOR VISITS QUEUED IN ^ADEPOST
S ADEFLG=0
I $D(^ADEPOST(0)) D KILLQ
I ADEFLG W !,"CANNOT UNLOCK PATIENT DENTAL RECORD: Patient has unposted data in the",!,"background queue. Contact site manager for assistance." G END
;
;------->KILL FLAG AND QUIT
K ^ADEUTL("ADELOCK",ADEPAT)
W !,"RESET!"
END K ADEFLG,ADEPAT Q
KILLQ S K=0 F J=0:0 S K=$O(^ADEPOST(K)) Q:'+K I $P(^ADEPOST(K),U,3)=ADEPAT S ADEFLG=1
Q
ADENODE ; IHS/HQT/MJL - RESET PATIENT UPDATE FLAG ; [ 03/24/1999 9:04 AM ]
+1 ;;6.0;ADE;;APRIL 1999
+2 ;IHS/HMW 5-5-92 Now checks ADEPOST & returns message if unposted data
+3 ;exists in the queue.
+4 ;------->INIT
+5 SET U="^"
+6 ;------->LOOKUP PT
+7 SET DIC="^AUPNPAT("
SET DIC(0)="AEMQZ"
DO ^DIC
IF Y<1
GOTO END
SET ADEPAT=+Y
+8 ;------->CHECK FOR VISITS QUEUED IN ^ADEPOST
+9 SET ADEFLG=0
+10 IF $DATA(^ADEPOST(0))
DO KILLQ
+11 IF ADEFLG
WRITE !,"CANNOT UNLOCK PATIENT DENTAL RECORD: Patient has unposted data in the",!,"background queue. Contact site manager for assistance."
GOTO END
+12 ;
+13 ;------->KILL FLAG AND QUIT
+14 KILL ^ADEUTL("ADELOCK",ADEPAT)
+15 WRITE !,"RESET!"
END KILL ADEFLG,ADEPAT
QUIT
KILLQ SET K=0
FOR J=0:0
SET K=$ORDER(^ADEPOST(K))
IF '+K
QUIT
IF $PIECE(^ADEPOST(K),U,3)=ADEPAT
SET ADEFLG=1
+1 QUIT