source: WorldVistAEHR/trunk/r/ENGINEERING-EN/ENARG.m@ 1800

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

initial load of WorldVistAEHR

File size: 5.9 KB
Line 
1ENARG ;(WCIOFO)/JED,SAB-GATHER ARCHIVAL RECORDS ;10/12/1999
2 ;;7.0;ENGINEERING;**40,50,63**;Aug 17, 1993
3 ;CALLED BY ENAR1 ;CALLS ENARG1
4 Q
5G ;GET SORT PARAMS
6 D STA G:ENERR'=0 OUT D @ENRT D:ENERR=0 MSG I ENERR'=0 G OUT
7G1 W !!,*7,"IS IT O.K. TO PROCEED" S %=2 D YN^DICN G:%<0 G1
8 I %=0 W !,"Proceeding will build a list of all records meeting the above criteria,",!,"and give you a count. This may take a considerable amount of time." G G1
9 I %'=1 S ENERR="UNCONFIRMED PROCEED" G OUT
10 D G^ENARG1,OUT Q
11 ;;
121 ; WORK ORDERS
13 D I Q:ENERR'=0
14 S DIR(0)="Y",DIR("A")="Include all shops",DIR("B")="YES"
15 S DIR("?",1)="You may archive for all shops, for selected shops, or for all shops except"
16 S DIR("?")="selected shops."
17 D ^DIR K DIR I $D(DIRUT) S ENERR="Shop Selection Failure" Q
18 I Y S ENSHOP("ALL")=1,ENPARAM="ALL SHOPS" Q
19 S DIR(0)="SM^I:Include selected shops;E:Exclude selected shops"
20 S DIR("A",1)="You will next be asked to select one or more shops. Do you wish to archive"
21 S DIR("A",2)="work orders for these shops (Include) or to archive work orders for all shops"
22 S DIR("A")="except those selected (Exclude)",DIR("B")="Include"
23 D ^DIR K DIR I $D(DIRUT)!("^I^E^"'[(U_Y_U)) S ENERR="Shop Selection Failure" Q
24 I Y="I" S ENSHOP("INC")=1,ENSHOP("EXC")=0,ENPARAM="INCLUDE SELECTED SHOPS"
25 E S ENSHOP("INC")=0,ENSHOP("EXC")=1,ENPARAM="EXCLUDE SELECTED SHOPS"
26 W ! S DIC="^DIC(6922,",DIC(0)="AEQM",DIC("A")=$S(ENSHOP("INC"):"Shop to be INCLUDED in archiving: ",ENSHOP("EXC"):"Shop to be EXCLUDED from archiving: ",1:"") I DIC("A")="" S ENERR="Shop Selection Failure" Q
27 F D ^DIC Q:Y'>0 S ENSHOP(+Y)=$P(Y,U,2)
28 I $O(ENSHOP(0))'?1.N S ENERR="Shop Selection Failure" Q
29 Q
30 ;
312 ; 2162 ACCIDENT REPORTS
32 D I S ENPARAM="NONE" Q
333 ;EQUIPMENT INV.
34 S X=$$FMADD^XLFDT(DT,-365)
35 S DIR(0)="D^:"_X_":EXP"
36 S DIR("B")=$$FMTE^XLFDT(X)
37 S DIR("A")="Archive Equipment dispositioned as of"
38 D ^DIR K DIR I $D(DIRUT) S ENERR="DISPOSITION DATE SELECT" Q
39 S ENTO=Y
40 S DIR(0)="Y",DIR("A")="Include Accountable NX equipment",DIR("B")="YES"
41 S DIR("?",1)="Answer NO to keep Accountable NX equipment from being"
42 S DIR("?",2)="archived. Accountable NX equipment is equipment that"
43 S DIR("?",3)="has its INVESTMENT CATEGORY field equal to either"
44 S DIR("?",3)="CAPITALIZED/ACCOUNTABLE or NOT CAPITALIZED/ACCOUNTABLE."
45 S DIR("?",6)=" "
46 S DIR("?")="Enter YES or NO"
47 D ^DIR K DIR I $D(DIRUT) S ENERR="ACCOUNTABLE NX SELECT" Q
48 S ENEQ("A")=Y
49 S DIR(0)="Y",DIR("A")="Include JCAHO Inventory equipment",DIR("B")="YES"
50 S DIR("?",1)="Answer NO to keep JCAHO Inventory equipment from being"
51 S DIR("?",2)="archived. JCAHO Inventory equipment is equipment whose"
52 S DIR("?",3)="JCAHO field equals YES."
53 S DIR("?",4)=" "
54 S DIR("?")="Enter YES or NO"
55 D ^DIR K DIR I $D(DIRUT) S ENERR="JCAHO INVENTORY SELECT" Q
56 S ENEQ("J")=Y
57 S ENPARAM=$S(ENEQ("A"):"INCL",1:"EXCL")_" ACCT NX, "
58 S ENPARAM=ENPARAM_$S(ENEQ("J"):"INCL",1:"EXCL")_" JCAHO"
59 S ENFR=""
60 Q
614 ; PROJECTS
62 S ENERR="Project Archiving is not supported."
63 Q
645 ; CONTROL POINT TRANSACTIONS
65 S ENERR="Control Point Activity transactions may be archived only thru IFCAP."
66 Q
67 ;
68STA ;PICK STATION
69 I $D(^DIC(6910,1,0)),$P(^(0),"^",2)'="",$P(^(0),"^",1)'="" S ENSTA=$P(^(0),"^",2),ENSTAN=$P(^(0),"^",1) W !,"Station Number: ",ENSTA,!,"Is this correct" S %=1 D YN^DICN Q:%=1 G STA:%=0,P1:%=2 S ENERR="STATION NUMBER" Q
70P1 S DIC="^DIC(4,",DIC(0)="AEQN",DIC("A")="Select STATION NUMBER: ",D="B" D IX^DIC S:Y<0 ENERR="STATION NUMBER" K DIC("A") Q:ENERR'=0 S ENSTA=+Y,ENSTAN=$P(Y,"^",2) Q
71 ;
72I ;INTERVAL SELECTION
73 W !,"Do you wish to archive by fiscal YEAR or QUARTER (Y or Q) Y// " R ENR:DTIME S:ENR="" ENR="Y" S ENR=$E(ENR)
74 G:"YQyq"[ENR I1 I ENR="?" D G I
75 . W !!," Please enter 'Y' for YEAR or 'Q' for QUARTER (or '^' to abort)...",!
76 S ENERR="INTERVAL SELECTION"
77 Q
78 ;
79I1 K ENFY,ENQT,ENFR,ENTO
80 I "Yy"[ENR D ; by fiscal year
81 . D FY Q:ENERR'=0
82 . S ENFR=(ENFY-1700-1)_"1000",ENTO=(ENFY-1700)_"0930"
83 I "Qq"[ENR D ; by quarter
84 . D FY Q:ENERR'=0
85 . D QTR Q:ENERR'=0
86 . I ENQT=1 S ENFR=(ENFY-1700-1)_"1000",ENTO=$E(ENFR,1,3)_"1231"
87 . I ENQT=2 S ENFR=(ENFY-1700)_"0100",ENTO=$E(ENFR,1,3)_"0331"
88 . I ENQT=3 S ENFR=(ENFY-1700)_"0400",ENTO=$E(ENFR,1,3)_"0630"
89 . I ENQT=4 S ENFR=(ENFY-1700)_"0700",ENTO=$E(ENFR,1,3)_"0930"
90 Q
91 ;
92FY ; ask fiscal year
93 ; return ENFY or ENERR'=0
94 N ENFYT
95 S ENFYT=$E(DT,1,3)+1700+$E(DT,4) ; default fiscal year
96FY1 W !,"SELECT FISCAL YEAR (4 digits): ",ENFYT,"//"
97 R ENFY:DTIME S:'$T ENFY="^" I $E(ENFY)="^" S ENERR="FISCAL YEAR" Q
98 S:ENFY="" ENFY=ENFYT
99 I ENFY'?4N!(ENFY<1900) D G FY1
100 . W $C(7),!!," Please enter the FISCAL YEAR (Oct 1 thru Sep 30) in"
101 . W !," four digit format. Work orders whose DATE COMPLETE is within"
102 . W !," this FISCAL YEAR will be archived.",!
103 Q
104 ;
105QTR ; ask quarter
106 ; return ENQT or ENERR'=0
107 N ENQTT
108 S ENQTT=$P("2^2^2^3^3^3^4^4^4^1^1^1",U,$E(DT,4,5)) ; default quarter
109QTR1 W !,"SELECT QUARTER (1, 2, 3, or 4): ",ENQTT,"//"
110 R ENQT:DTIME S:'$T ENQT="^" I $E(ENQT)="^" S ENERR="FISCAL QUARTER" Q
111 S:ENQT="" ENQT=ENQTT
112 I ENQT'?1N!(ENQT<1)!(ENQT>4) D G QTR1
113 . W $C(7),!!," Answer must be 1, 2, 3, or 4!",!
114 Q
115 ;
116MSG W !!,*7,"You have requested to locate all " S ENMSG="MSG"_ENRT D @ENMSG
117 Q
118 ;
119MSG1 W "work orders completed for " I $G(ENSHOP("ALL")) W "all shops " D MSGA Q
120 S X=$S(ENSHOP("INC"):"the following shops:",1:"all shops EXCEPT:") W X
121 S I=0 F S I=$O(ENSHOP(I)) Q:I'?1.N W !,?5,I,?10,ENSHOP(I)
122 W ! D MSGA
123 Q
124 ;
125MSG2 W !,"2162 accident reports, whose occurrence date was" D MSGA
126 Q
127 ;
128MSG3 W "equipment records with a DISPOSITION DATE"
129 W !,"prior to ",$$FMTE^XLFDT(ENTO),", "
130 W $S(ENEQ("A"):"including",1:"excluding")," Accountable NX equipment and ",$S(ENEQ("J"):"including",1:"excluding")
131 W !,"JCAHO Inventory equipment."
132 Q
133 ;
134MSGA W:$X>50 ! W "in Fiscal Year ",ENFY W:$D(ENQT) ", ",ENQT,$S(ENQT=1:"st",ENQT=2:"nd",ENQT=3:"rd",ENQT=4:"th",1:"error")," Quarter" W "." Q
135OUT K D,DIC,ENA,ENEQ,ENFR,ENFY,ENFYT,ENMSG,ENPARAM,ENSHOP,ENQT,ENQTT,ENR,ENSH,ENSTA,ENSTAN,ENTO,I,Y Q
136 ;ENARG
Note: See TracBrowser for help on using the repository browser.