source: WorldVistAEHR/trunk/r/SCHEDULING-SD-SC/SDACSCGB.m@ 861

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

initial load of WorldVistAEHR

File size: 3.4 KB
RevLine 
[613]1SDACSCGB ;ALBISC/TET - BATCH UPDATE COMP GEN APPT TYPES FOR C&P'S ;3/23/92 13:59
2 ;;5.3;Scheduling;**132**;Aug 13, 1993
3 ;
4BATCH ; - enter here for batch update cg appt types fm cg (possible C&P) to C&P
5READ ;enter here to read
6 D ASK2^SDDIV G EXIT:Y<0
7 ;
8R1 ; -- get date range
9 S DIR(0)="D^::ET"
10 S DIR("A")="Enter Beginning Date"
11 S DIR("?")="^D HELP^%DTC"
12 D ^DIR K DIR G:$D(DIRUT) EXIT
13 S SDBEG=Y
14 I SDBEG>DT W !," Future dates are not allowed.",*7 G R1
15 D DD^%DT S FR=Y
16 ;
17 S DIR(0)="D^"_SDBEG_":NOW:TE"
18 S DIR("A")="Enter Ending Date"
19 S DIR("?")="^D HELP^%DTC"
20 D ^DIR K DIR G:$D(DIRUT) EXIT
21 S SDBEG=SDBEG-.0001,SDEND=Y_".9999"
22 D DD^%DT S TO=Y
23 ;
24 ; -- display selections
25 W !!?8,"Selected date range begins on ",FR," and ends on ",TO
26 W !?8,"Division: ",$S(VAUTD:"ALL",1:"")
27 IF 'VAUTD S SDDIV=0 F I=1:1 S SDDIV=$O(VAUTD(SDDIV)) Q:'SDDIV D
28 . W:'(I#2) ?45,VAUTD(SDDIV),!
29 . W:(I#2) ?20,VAUTD(SDDIV)
30 W !!
31 ;
32 S DIR("A",1)=" This option will automatically update the Computer Generated"
33 S DIR("A",2)=" appointment types which are possible C&P to C&P appointment"
34 S DIR("A",3)=" type for the above parameters."
35 S DIR("A",4)=""
36 S DIR("A")=" Are you sure you wish to continue"
37 S DIR("?")="Enter 'Yes' to automatically update appointment type, 'No' to exit."
38 S DIR("?",1)="You should exercise this option after you have reviewed"
39 S DIR("?",2)="visits which have an appointment type of 'Computer Generated'"
40 S DIR("?",3)="AND after you have selectively edited any possible C&Ps which are not."
41 S DIR("?",4)=" "
42 S DIR("?",5)="This option will then update all remaining visits which have"
43 S DIR("?",6)="a computer generated appointment type due to a possible C&P visit"
44 S DIR("?",7)="to a Comp & Pen appointment type for the parameters selected."
45 S DIR("?",8)=" "
46 S DIR(0)="YO"
47 D ^DIR K DIR G:$D(DIRUT)!('Y) EXIT
48 ;
49 ; -- queue job
50 S DGVAR="SDBEG^SDEND^VAUTD#"
51 S DGPGM="UPD^SDACSCGB"
52 D ZIS^DGUTQ
53 G:POP EXIT
54 ;
55UPD ; -- queue entry point
56 N SDT,SDOE,SDOE0,SDOECG,SDDIV,DFN,SDDAT,DASH,PG,CT,SDAPTYPR,Y,VA
57 ;
58 S (PG,CT)=0
59 S DASH="",$P(DASH,"-",79)=""
60 W:$E(IOST,1,2)="C-" @IOF
61 D HDR
62 ;
63 S SDT=0
64 F S SDT=$O(^SCE("ACG",SDT)) Q:'SDT D G:$D(DIRUT) EXIT
65 . S SDOE=0
66 . F S SDOE=$O(^SCE("ACG",SDT,SDOE)) Q:'SDOE D Q:$D(DIRUT)
67 . . S SDOE0=$G(^SCE(SDOE,0))
68 . . S SDOECG=$G(^SCE(SDOE,"CG"))
69 . . S SDDAT=+SDOE0
70 . . S SDDIV=+$P(SDOE0,U,11)
71 . . S DFN=$P(SDOE0,U,2)
72 . . S SDAPTYPR=+$P(SDOECG,U,2)
73 . . IF VAUTD!($D(VAUTD(SDDIV))),SDDAT'<SDBEG,SDDAT'>SDEND D Q:$D(DIRUT)
74 . . . S Y=SDDAT D DD^%DT S SDY=Y
75 . . . D DEM^VADPT
76 . . . IF SDAPTYPR=2 D DIE
77 ;
78 W !?10,CT," Visit"_$S(CT=1:"",1:"s")_" updated ...Batch update complete.",*7
79 ;
80EXIT ; -- exit logic
81 K %DT,CT,D,DA,DASH,DE,DFN,DFN0,DGPGM,DIC,DIE,DIRUT,DQ,DR
82 K DTOUT,DUOUT,FR,I,J,PG,POP,SDA,SDAPTYPR,SDBEG,SDCSNODE
83 K SDDAT,SDDIV,SDEND,SDUPDT,SDY,SDZN,SDTYPE,TO,VADM,VAEL
84 K VAERR,VAUTD,VA,X,Y
85 D CLOSE^DGUTQ
86 Q
87 ;
88DIE ; -- update entry
89 N DIE,DR,DA,DE,DQ
90 S DIE="^SCE(",DA=SDOE,DR=".1////^S X=1;202///@" D ^DIE
91 ;
92 S CT=CT+1
93 D:$Y+6>IOSL CR Q:$D(DIRUT)
94 W !,SDY,?35,$S('VAERR:$E(VADM(1),1,30),1:"UNKNOWN")
95 Q
96 ;
97CR ; -- end of page processing
98 I $D(IOST),$E(IOST,1,2)="C-" D Q:$G(DIRUT)
99 . S DIR(0)="E"
100 . W ! D ^DIR K DIR
101 . I $D(DUOUT)!($D(DTOUT)) D
102 . . S DIRUT=1
103 . . W !,SDY,?35,$S('VAERR:$E(VADM(1),1,30),1:"UNKNOWN"),!!,"Update incomplete!",*7
104 W @IOF D HDR
105 Q
106 ;
107HDR ; -- header processing
108 S PG=PG+1
109 W !?17,"UPDATED COMPUTER GENERATED APPOINTMENT TYPES",!!,"Date/Time",?35,"Name",?68,"Page ",PG,!,DASH,!!
110 Q
111 ;
Note: See TracBrowser for help on using the repository browser.