source: WorldVistAEHR/trunk/r/LAB_SERVICE-LR-LS/LRAR06.m@ 613

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

initial load of WorldVistAEHR

File size: 4.3 KB
Line 
1LRAR06 ;DALLAS/HOAK CUME ARCHIVE INITIATIVE part of 00 ; 12/12/96 10:16 ;
2 ;;5.2;LAB SERVICE;**111**;Sep 27, 1994
3INIT ;
4RESTART ;
5 W !,"Search not complete." L +^LAR:1
6 I '$T W !,"Searching in progress, please wait for it to finish." G QUIT
7 L -^LAR
8 W !,"Do you want to restart the search"
9 S %=1 D YN^DICN
10 I %'=1 W:%=0 !,"Continue where the last search stopped." G RESTART:%=0,QUIT
11 ;
12 D DEV^LRAR01
13 G QUIT:POP S LRDFN=$S($D(^LAB(69.9,1,"LRDFN")):^("LRDFN"),1:0)
14 D STEPOUT^LRARCHIV QUIT
15TAPE ;
16 S DA=0,DIC="^LAB(69.9,1,6,"
17 S DIC("A")="Please enter a name for the archive session: "
18 S DIC(0)="AEMQL"
19 S DLAYGO=69 D ^DIC
20 K DLAYGO Q:Y<1
21 S LRDA9=+Y
22 I '$P(Y,U,3) W !,"You must create a NEW name for this ARCHIVE." G TAPE
23DT ;
24 S OK=1
25SET S DIR(0)="S^1:CH Subcript only;2:Micro Only;3:Both CH and Micro"
26 S DIR("??")="Enter 1 for CH subscripted. Micro will be with next patch"
27 S DIR("?")="Please enter a number 1"
28 S DIR("A")="What lab section do you wish to Search"
29 S DIR("B")="1"
30 D ^DIR
31 I $D(DTOUT)!($D(DUOUT)) S OK=0 S DA=-1
32 Q:'OK
33 ;S LRWHICH=$S(Y=1:"CH",Y=2:"MI",1:"BOTH") ;--NEXT PATCH
34 S LRWHICH="CH"
35 ;
36 K DIR
37 ;
38 S DIR(0)="D",DIR("A")="Archive Start DATE: "
39 S DIR("?")="Enter a date in the past where I should begin looking."
40 S DIR("B")="T-90"
41 D ^DIR
42 I $D(DTOUT)!($D(DUOUT)) S OK=0 S DA=-1
43 S LR(1)=+Y
44 Q:'OK
45 S DA=LRDA9
46 Q:'$G(DA)
47 S P1=DA,DIE=DIC,DR="1;2///N;4///"_LR(1)
48 D ^DIE
49 K DIC
50 ;QUIT
51 ;
52 K DIR
53 ;
54TIME ;
55 ;--> Maximize user interaction.
56 S OK=1
57 I '$G(LR(1)) S LR(1)=DT
58 S DIR(0)="S^1:Number of days;2:Date Range;3:By the month;4:Quarterly;5:By the year"
59 S DIR("?")="Enter 1 for days to archive ie 1,7,30,60,90 etc"
60 S DIR("?",1)="Enter 2 for Patients results between a date range."
61 S DIR("?",2)="Enter 3 for a specific month and year...11/97"
62 S DIR("?",3)="Enter 4 ... 1/97 for Jan-Feb-Mar of 1997 or 2/97 for Apr-May-June of 1997 etc"
63 S DIR("?",4)="Enter 5 year 1996 gets you all of 1996"
64 S DIR("B")="1"
65 D ^DIR
66 I $D(DUOUT)!($D(DTOUT))!(+Y'>0) W !!,"OK BYE BYE" S OK=0 QUIT
67 ;
68 S LRD0=$S(Y=1:"FIRST",Y=2:"SECOND",Y=3:"THIRD",Y=4:"FOURTH",1:"FIFTH")
69 S OK=1 S LRD0="D "_LRD0
70 X LRD0
71 ;
72 K DIR
73 I 'OK D END QUIT
74 S LREDT3=LREDT
75 ;
76 QUIT
77 ;
78END ;
79QUIT ;
80 D QUIT^LRARCHIV
81 QUIT
82 ;
83 ;
84FIRST ;--------->by nuber of days
85 K DIR SET DIR(0)="N" S DIR("B")="90" S DIR("A")="Enter # of days"
86 D ^DIR
87 I $D(DUOUT)!($D(DTOUT))!(+Y'>0) W !!,"OK BYE BYE" S OK=0 QUIT
88 S X1=LR(1),X2=-Y D C^%DTC
89 W !,$$FMTE^XLFDT(X,"D")," TO ",$$FMTE^XLFDT(LR(1),"D")
90 S LREDT=X
91 K DIR D PASTIT
92 QUIT
93SECOND ;---------->by date range
94 S %DT="AE"
95 S %DT("B")="T-90"
96 S %DT("A")="Start Date: "
97 D ^%DT I Y'>0 S OK=0 D END QUIT
98 S LR(1)=Y
99 S %DT("B")="T-30"
100 S %DT("A")="Ending Date: "
101 D ^%DT I Y'>0 S OK=0 D END QUIT
102 S LREDT=Y
103 S LRY0=LREDT,LREDT=LR(1),LR(1)=LRY0 ;SWAP
104 ;I LR(1)>LREDT S X=LR(1),LR(1)=LREDT,LREDT=X
105 K %DT
106 D PASTIT
107 QUIT
108THIRD ;----------->by month
109 S %DT="AE"
110 S %DT("B")=+$E(DT,4,5)_"/"_+$E(DT,2,3)
111 S %DT("?")="Enter Month/Year...May 1997...June 1994"
112 S %DT("??")="9/94 for September 1994"
113 S %DT("A")="Month and year: "
114 D ^%DT I Y'>0 S OK=0 QUIT
115 ;
116 I +$E(Y,4,4)++$E(Y,5,5)'>0 W !!,"You forgot the month." G THIRD
117 ;
118 S LR(1)=$E(Y,1,5)_"01" S LREDT=$E(LR(1),1,3)_$E(LR(1),4,5)+1_"01"
119 S LRY0=LREDT,LREDT=LR(1),LR(1)=LRY0 ;SWAP
120 K %DT
121 D PASTIT
122 QUIT
123 ;
124FOURTH ;--------------->by quarter
125 K DIR
126 S DIR(0)="S^1:1st Quarter;2:2nd Quarter;3:3rd Quarter;4:4th Quarter"
127 S DIR("B")=1
128 S DIR("?")="1=Jan-Feb-Mar 2=Apr-May-June 3=Jul-Aug-Sep 4=Oct-Nov-Dec"
129 D ^DIR
130 I $D(DTOUT)!($D(DUOUT)) S OK=0 D END QUIT
131 S LRQQ=Y
132 D AGAIN
133 S LRQQ=$S(LRQQ=1:"FIRSTQ(LRYEAR)",LRQQ=2:"SECONDQ(LRYEAR)",LRQQ=3:"THIRDQ(LRYEAR)",1:"FOURTHQ(LRYEAR)")
134 S LRQQ="D "_LRQQ X LRQQ
135 D PASTIT
136 QUIT
137AGAIN ;
138 ;
139 I 'OK D END QUIT
140 K %DT
141 S %DT="AE" S %DT("A")="Please Enter a Year: "
142 S %DT("B")=$S($E(DT,1,1)=2:19_$E(DT,2,3),1:20_$E(DT,2,3))
143 D ^%DT
144 I Y'>0 S OK=0 D END QUIT
145 S LRYEAR=Y
146 QUIT
147 ;
148FIFTH ;
149 D AGAIN
150 I 'OK D END QUIT
151 S LR(1)=$E(Y,1,3)_0101
152 S LREDT=$E(Y,1,3)_1231
153 ;
154PASTIT ;
155 ;W !!,"LREDT=",LREDT,"<------>LR(1)=",LR(1)
156 Q
157QUARTER ;
158 ;
159FIRSTQ(LRYEAR) ;
160 S LRYQ=$E(LRYEAR,2,3)
161 S LR(1)=2_LRYQ_"0101",LREDT=2_LRYQ_"0331"
162 QUIT
163 ;
164SECONDQ(LRYEAR) ;
165 S LRYQ=$E(LRYEAR,2,3)
166 S LR(1)=2_LRYQ_"0401",LREDT=2_LRYQ_"0630"
167 QUIT
168 ;
169THIRDQ(LRYEAR) ;
170 S LRYQ=$E(LRYEAR,2,3)
171 S LR(1)=2_LRYQ_"0701",LREDT=2_LRYQ_"0930"
172 QUIT
173 ;
174FOURTHQ(LRYEAR) ;
175 S LRYQ=$E(LRYEAR,2,3)
176 S LR(1)=2_LRYQ_"1001",LREDT=2_LRYQ_"1231"
177 QUIT
178 ;
179DAYS ;
180 ;
181 Q
182 ;
183 QUIT
Note: See TracBrowser for help on using the repository browser.