SCCVEDI ;ALB/RMO,TMP - Disposition Conversion; [ 03/28/95 9:18 AM ]
;;5.3;Scheduling;**211**;Aug 13, 1993
;
EN(SCCVEVT,SCSTDT,SCENDT,SCLOG,SCREQ,SCSTOP) ;Entry point to loop through all dispositions for a specified date range
; Input -- SCCVEVT Conversion event
; SCSTST Start date
; SCENDT End date
; SCLOG Scheduling conversion log IEN
; SCREQ Scheduling conversion request IEN
; Output -- SCSTOPF Conversion stop flag
N SCDTM
S SCDTM=0
F SCDTM=SCSTDT:0 S SCDTM=$O(^DPT("ADIS",SCDTM)) Q:'SCDTM!($P(SCDTM,".")>SCENDT)!($G(SCSTOPF)) D PAT(SCCVEVT,SCDTM,SCLOG,SCREQ,.SCSTOPF)
ENQ Q
;
PAT(SCCVEVT,SCDTM,SCLOG,SCREQ,SCSTOPF) ;Loop through patient dispositions for a specified date range
; Input -- SCCVEVT Conversion event
; SCDTM Disposition date/time
; SCLOG Scheduling conversion log IEN
; SCREQ Scheduling conversion request IEN
; Output -- SCSTOPF Conversion stop flag
N DFN
F DFN=0:0 S DFN=$O(^DPT("ADIS",SCDTM,DFN)) Q:'DFN!($G(SCSTOPF)) I $D(^DPT(DFN,"DIS",+$O(^(DFN,0)),0)),$P(^(0),U,2)'=2 D
. IF SCCVEVT D ZERO(DFN)
. D EN^SCCVEDI1(SCCVEVT,DFN,SCDTM,SCLOG)
. D STOP^SCCVLOG(SCLOG,SCREQ,.SCSTOPF)
PATQ Q
;
ZERO(DFN) ; -- fix zeroth if missing
IF '$D(^DPT(DFN,"DIS",0)),$O(^DPT(DFN,"DIS",0)) S ^DPT(DFN,"DIS",0)="^2.101D^^"
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HSCCVEDI 1384 printed Dec 13, 2024@02:38:48 Page 2
SCCVEDI ;ALB/RMO,TMP - Disposition Conversion; [ 03/28/95 9:18 AM ]
+1 ;;5.3;Scheduling;**211**;Aug 13, 1993
+2 ;
EN(SCCVEVT,SCSTDT,SCENDT,SCLOG,SCREQ,SCSTOP) ;Entry point to loop through all dispositions for a specified date range
+1 ; Input -- SCCVEVT Conversion event
+2 ; SCSTST Start date
+3 ; SCENDT End date
+4 ; SCLOG Scheduling conversion log IEN
+5 ; SCREQ Scheduling conversion request IEN
+6 ; Output -- SCSTOPF Conversion stop flag
+7 NEW SCDTM
+8 SET SCDTM=0
+9 FOR SCDTM=SCSTDT:0
SET SCDTM=$ORDER(^DPT("ADIS",SCDTM))
if 'SCDTM!($PIECE(SCDTM,".")>SCENDT)!($GET(SCSTOPF))
QUIT
DO PAT(SCCVEVT,SCDTM,SCLOG,SCREQ,.SCSTOPF)
ENQ QUIT
+1 ;
PAT(SCCVEVT,SCDTM,SCLOG,SCREQ,SCSTOPF) ;Loop through patient dispositions for a specified date range
+1 ; Input -- SCCVEVT Conversion event
+2 ; SCDTM Disposition date/time
+3 ; SCLOG Scheduling conversion log IEN
+4 ; SCREQ Scheduling conversion request IEN
+5 ; Output -- SCSTOPF Conversion stop flag
+6 NEW DFN
+7 FOR DFN=0:0
SET DFN=$ORDER(^DPT("ADIS",SCDTM,DFN))
if 'DFN!($GET(SCSTOPF))
QUIT
IF $DATA(^DPT(DFN,"DIS",+$ORDER(^(DFN,0)),0))
IF $PIECE(^(0),U,2)'=2
Begin DoDot:1
+8 IF SCCVEVT
DO ZERO(DFN)
+9 DO EN^SCCVEDI1(SCCVEVT,DFN,SCDTM,SCLOG)
+10 DO STOP^SCCVLOG(SCLOG,SCREQ,.SCSTOPF)
End DoDot:1
PATQ QUIT
+1 ;
ZERO(DFN) ; -- fix zeroth if missing
+1 IF '$DATA(^DPT(DFN,"DIS",0))
IF $ORDER(^DPT(DFN,"DIS",0))
SET ^DPT(DFN,"DIS",0)="^2.101D^^"
+2 QUIT