source: WorldVistAEHR/trunk/r/DSS_EXTRACTS-ECX/ECXTREX.m@ 1211

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

revised back to 6/30/08 version

File size: 3.1 KB
Line 
1ECXTREX ;BPFO/JRP - Queue DSS Fiscal Year Specific Extract;8-AUG-2003 ; 11/2/06 9:02am
2 ;;3.0;DSS EXTRACTS;**49,71,84,92**;Dec 22, 1997;Build 30
3 ;
4EN ;Main entry point
5 W @IOF
6 N DIC,X,Y,DTOUT,DUOUT
7 W !,"****************************************************************"
8 W !,"* *"
9 W !,"* This option should be used with caution as it allows for the *"
10 W !,"* extraction of data using specified fiscal year logic. This *"
11 W !,"* gives the ability to extract fiscal year 200x data using *"
12 W !,"* fiscal year 200(x+1) logic and vice versa. Note that data *"
13 W !,"* extracted via this method may or may not be transmittable to *"
14 W !,"* the DSS production queue at the Austin Automation Center. *"
15 W !,"* *"
16 W !,"*--------------------------------------------------------------*"
17 W !,"* *"
18 W !,"* Note that this option does not update the last date used for *"
19 W !,"* the given extraction. It also does not verify that the time *"
20 W !,"* frame selected is after the last date used for the extract. *"
21 W !,"* *"
22 W !,"****************************************************************"
23 W !!
24 ;Pick extract to queue
25 S DIC="^ECX(727.1,"
26 S DIC(0)="AEQMZ"
27 S DIC("A")="Select DSS Extract to queue: "
28 S DIC("S")="I ('$P(^(0),U,12))&($P(^(0),U,8)'="""")&($G(^(7))'[""Inactive"")"
29 S DIC("W")="W ""("",$P(^(0),U,8),"")"""
30 D ^DIC
31 I ($D(DUOUT))!($D(DTOUT))!(Y<1) Q
32 N ECXRTN,ECXDA
33 S ECXDA=+Y
34 ;Get extract specific routine name
35 S ECXRTN=$G(^ECX(727.1,ECXDA,"ROU"))
36 I ECXRTN="" D Q
37 .W !!,"Selected extract is not correctly defined in the EXTRACT"
38 .W !,"DEFINITIONS file (#727.1). The ROUTINE field (#4) does not"
39 .W !,"have a value in it."
40 .W !
41 .D PAUSE
42 ;Get time frame for extract
43 N STRTDT,ENDDT,DIR,DIRUT,DIROUT,OUT,ECXDATES
44 S OUT=0 F S (STRTDT,ENDDT)="" D Q:OUT
45 .;Get start date (must be in past)
46 .S DIR(0)="DOA"
47 .S $P(DIR(0),"^",2)=":"_DT_":AEXP"
48 .S DIR("A")="Starting with Date: "
49 .D ^DIR
50 .I $D(DIROUT)!$D(DIRUT)!(Y="") S (STRTDT,ENDDT)="" S OUT=1 Q
51 .S STRTDT=Y
52 .K DIR
53 .;Get end date (must be in same month; must be in past)
54 .S DIR(0)="DOA"
55 .S X=$E(STRTDT,1,5)_"01"
56 .S X=$$FMADD^XLFDT(X,32)
57 .S X=$$FMADD^XLFDT(X,-($E(X,6,7)))
58 .I X>DT S X=DT
59 .S $P(DIR(0),"^",2)=STRTDT_":"_X_":AEXP"
60 .S DIR("A")="Ending with Date: "
61 .S DIR("B")=$$FMTE^XLFDT(X,"5D")
62 .D ^DIR
63 .I $D(DIROUT)!$D(DIRUT)!(Y="") S (STRTDT,ENDDT)="" S OUT=1 Q
64 .S ENDDT=Y
65 .S OUT=1
66 Q:(STRTDT="")!(ENDDT="")
67 S ECXDATES=STRTDT_"^"_ENDDT_"^1"
68 ;Get extract logic to use
69 N ECXLOGIC
70 K DIR
71 S DIR("A")="Select fiscal year logic to use for extract"
72 S DIR(0)="SO^"
73 F X=2003,2004,2005,2006,2007 D
74 .S Y=$E(X,5)
75 .S Y=$S((Y="")!(Y=" "):"",1:"Revision "_Y_" of ")
76 .S DIR(0)=DIR(0)_X_":"_Y_"Fiscal Year "_$E(X,1,4)_";"
77 D ^DIR
78 I $D(DIROUT)!$D(DIRUT) Q
79 S ECXLOGIC=Y
80 ;Queue extract
81 D @("BEG^"_ECXRTN)
82 Q
83PAUSE ;pause screen
84 N DIR,X,Y,DTOUT,DUOUT,DIROUT,DIRUT
85 S DIR(0)="E"
86 W !!
87 D ^DIR
88 W !!
89 Q
Note: See TracBrowser for help on using the repository browser.