source: FOIAVistA/trunk/r/SCHEDULING-SD-SC/SCCVEAP.m@ 1379

Last change on this file since 1379 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 2.1 KB
Line 
1SCCVEAP ;ALB/RMO,TMP - Appointment Conversion; [ 03/31/95 11:23 AM ]
2 ;;5.3;Scheduling;**211**;Aug 13, 1993
3 ;
4EN(SCCVEVT,SCSTDT,SCENDT,SCLOG,SCREQ,SCDFN,SCSTOPF) ;Entry point to loop through all appointments for a specified date range
5 ; Input -- SCCVEVT Conversion event
6 ; 0 = Estimate 1 = Convert 2 = Re-convert
7 ; SCSTDT Start date
8 ; SCENDT End date
9 ; SCLOG Scheduling conversion log IEN
10 ; SCREQ Scheduling conversion request IEN
11 ; SCDFN If restarting, the DFN to start with
12 ; Output -- SCSTOPF Conversion stop flag
13 ;Loop through all patients
14 I '$G(SCSTOPF) D ALLPAT(SCCVEVT,SCSTDT,SCENDT,SCLOG,SCREQ,+$G(SCDFN),.SCSTOPF)
15 Q
16 ;
17ALLPAT(SCCVEVT,SCSTDT,SCENDT,SCLOG,SCREQ,SCDFN,SCSTOPF) ;Loop through all patients
18 ; Input -- SCCVEVT Conversion event
19 ; SCSTDT Start date
20 ; SCENDT End date
21 ; SCLOG Scheduling conversion log IEN
22 ; SCREQ Scheduling conversion request IEN
23 ; SCDFN If restarting, the DFN to start with
24 ; Output -- SCSTOPF Conversion stop flag
25 N DFN
26 S DFN=$S($G(SCDFN):SCDFN-1,1:0)
27 F S DFN=$O(^DPT(DFN)) Q:'DFN!($G(SCSTOPF)) D PAT(SCCVEVT,DFN,SCSTDT,SCENDT,SCLOG,SCREQ,.SCSTOPF)
28 Q
29 ;
30PAT(SCCVEVT,DFN,SCSTDT,SCENDT,SCLOG,SCREQ,SCSTOPF) ;Loop through a patient's appointments
31 ; Input -- SCCVEVT Conversion event
32 ; DFN Patient IEN
33 ; SCSTDT Start date
34 ; SCENDT End date
35 ; SCLOG Scheduling conversion log IEN
36 ; SCREQ Scheduling conversion request IEN
37 ; Output -- SCSTOPF Conversion stop flag
38 N SCCLN,SCDTM
39 IF SCCVEVT D ZERO(DFN)
40 F SCDTM=SCSTDT:0 S SCDTM=$O(^DPT(DFN,"S",SCDTM)) Q:'SCDTM!($P(SCDTM,".")>SCENDT)!($G(SCSTOPF)) I $D(^(SCDTM,0)) S SCCLN=^(0) I $P(SCCLN,U,2)=""!($P(SCCLN,U,2)="I")!($P(SCCLN,U,2)="NT"),$P($G(^SC(+SCCLN,0)),U,3)="C" D
41 . S SCCLN=+SCCLN
42 . D EN^SCCVEAP1(SCCVEVT,DFN,SCDTM,SCCLN,"",SCLOG)
43 . D STOP^SCCVLOG(SCLOG,SCREQ,.SCSTOPF)
44PATQ K SCDA
45 Q
46 ;
47ZERO(DFN) ; -- fix zeroth node if missing
48 IF '$D(^DPT(DFN,"S",0)),$O(^DPT(DFN,"S",0)) S ^DPT(DFN,"S",0)="^2.98P^^"
49 Q
50 ;
Note: See TracBrowser for help on using the repository browser.