BSDN1 ; IHS/ANMC/LJF - IHS CHANGES TO NO-SHOW LETTERS ;
;;5.3;PIMS;;APR 26, 2002
;
ARBK(DATE) ;EP; called by SDN1 to find if uncancelled auto-rebooked appt exists
; -- DATE is date of rebooked appt; returns value to SDR
NEW BSDY,BSDZ
S BSDY=$P($G(^DPT(DFN,"S",DATE,0)),U,2) ;appt status
I (BSDY="")!(BSDY="NT")!(BSDY="I") Q 1 ;appt okay
I BSDY'["A" Q 0 ;not rebooked
S BSDZ=$P(^DPT(DFN,"S",DATE,0),U,10) ;rebook appt date/time
I BSDZ="" Q 0 ;not really rebooked
Q $$ARBK(BSDZ)
;
FINDA ;EP called by SDN1 to find uncanceled auto-rebooked appt
;follows path thru every rebooked no-show and cancellation
; -- variables to reset SDX,SDC,S
NEW BSDX,BSDY,BSDZ
S BSDX=SDX
S BSDY=$P($G(^DPT(DFN,"S",BSDX,0)),U,2) ;appt status
I (BSDY="")!(BSDY="NT")!(BSDY="I") Q ;okay
I BSDY="C"!(BSDY="N") S BSDQ="" Q ;deadend, no new appt
S BSDZ=$P(^DPT(DFN,"S",BSDX,0),U,10) ;rebooked appt date/time
I BSDZ="" S BSDQ="" Q ;deadend all cancelled
;
; reset appt date, data node and clinic then loop again
S SDX=BSDZ,S=^DPT(DFN,"S",SDX,0),SDC=$P(^(0),U)
D FINDA
Q
;
RBKDT(SDX,DFN) ;EP called by SDNOS1 to return date of uncancld rebooked appt
NEW SDC,S D FINDA Q SDX
BSDN1 ; IHS/ANMC/LJF - IHS CHANGES TO NO-SHOW LETTERS ;
+1 ;;5.3;PIMS;;APR 26, 2002
+2 ;
ARBK(DATE) ;EP; called by SDN1 to find if uncancelled auto-rebooked appt exists
+1 ; -- DATE is date of rebooked appt; returns value to SDR
+2 NEW BSDY,BSDZ
+3 ;appt status
SET BSDY=$PIECE($GET(^DPT(DFN,"S",DATE,0)),U,2)
+4 ;appt okay
IF (BSDY="")!(BSDY="NT")!(BSDY="I")
QUIT 1
+5 ;not rebooked
IF BSDY'["A"
QUIT 0
+6 ;rebook appt date/time
SET BSDZ=$PIECE(^DPT(DFN,"S",DATE,0),U,10)
+7 ;not really rebooked
IF BSDZ=""
QUIT 0
+8 QUIT $$ARBK(BSDZ)
+9 ;
FINDA ;EP called by SDN1 to find uncanceled auto-rebooked appt
+1 ;follows path thru every rebooked no-show and cancellation
+2 ; -- variables to reset SDX,SDC,S
+3 NEW BSDX,BSDY,BSDZ
+4 SET BSDX=SDX
+5 ;appt status
SET BSDY=$PIECE($GET(^DPT(DFN,"S",BSDX,0)),U,2)
+6 ;okay
IF (BSDY="")!(BSDY="NT")!(BSDY="I")
QUIT
+7 ;deadend, no new appt
IF BSDY="C"!(BSDY="N")
SET BSDQ=""
QUIT
+8 ;rebooked appt date/time
SET BSDZ=$PIECE(^DPT(DFN,"S",BSDX,0),U,10)
+9 ;deadend all cancelled
IF BSDZ=""
SET BSDQ=""
QUIT
+10 ;
+11 ; reset appt date, data node and clinic then loop again
+12 SET SDX=BSDZ
SET S=^DPT(DFN,"S",SDX,0)
SET SDC=$PIECE(^(0),U)
+13 DO FINDA
+14 QUIT
+15 ;
RBKDT(SDX,DFN) ;EP called by SDNOS1 to return date of uncancld rebooked appt
+1 NEW SDC,S
DO FINDA
QUIT SDX