AUPNLKZ ; IHS/CMI/LAB - SET AND RESET DUZ(2) ;
;;99.1;IHS DICTIONARIES (PATIENT);;MAR 09, 1999
;
; This routine is called to save DUZ(2) and set it to
; zero, then restore DUZ(2) to its original value. The
; calls must be made to the two entry points and it makes
; no sense to call RESET unless SET was previously called.
;
; If SET is called and DUZ(2) does not exists this
; routine will abort.
;
Q ; Invalid entry point
;
SET ;EP - SAVE DUZ(2) AND SET TO ZERO
S:'($D(AUPNDUZ)#2) AUPNDUZ=0
S AUPNDUZ=AUPNDUZ+1
S AUPNDUZ(AUPNDUZ)=DUZ(2)
S DUZ(2)=0
Q
;
RESET ;EP - RESTORE DUZ(2)
Q:'($D(AUPNDUZ)#2)
S DUZ(2)=AUPNDUZ(AUPNDUZ)
K AUPNDUZ(AUPNDUZ)
S AUPNDUZ=AUPNDUZ-1
K:'AUPNDUZ AUPNDUZ
Q
AUPNLKZ ; IHS/CMI/LAB - SET AND RESET DUZ(2) ;
+1 ;;99.1;IHS DICTIONARIES (PATIENT);;MAR 09, 1999
+2 ;
+3 ; This routine is called to save DUZ(2) and set it to
+4 ; zero, then restore DUZ(2) to its original value. The
+5 ; calls must be made to the two entry points and it makes
+6 ; no sense to call RESET unless SET was previously called.
+7 ;
+8 ; If SET is called and DUZ(2) does not exists this
+9 ; routine will abort.
+10 ;
+11 ; Invalid entry point
QUIT
+12 ;
SET ;EP - SAVE DUZ(2) AND SET TO ZERO
+1 IF '($DATA(AUPNDUZ)#2)
SET AUPNDUZ=0
+2 SET AUPNDUZ=AUPNDUZ+1
+3 SET AUPNDUZ(AUPNDUZ)=DUZ(2)
+4 SET DUZ(2)=0
+5 QUIT
+6 ;
RESET ;EP - RESTORE DUZ(2)
+1 IF '($DATA(AUPNDUZ)#2)
QUIT
+2 SET DUZ(2)=AUPNDUZ(AUPNDUZ)
+3 KILL AUPNDUZ(AUPNDUZ)
+4 SET AUPNDUZ=AUPNDUZ-1
+5 IF 'AUPNDUZ
KILL AUPNDUZ
+6 QUIT