source: FOIAVistA/tag/r/CMOP-PSX/PSXCST1.m@ 1672

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

initial load of FOIAVistA 6/30/08 version

File size: 1.6 KB
Line 
1PSXCST1 ;BIR/JMB-Date Range Compile/Recompile Cost Data-CONTINUED ;[ 04/08/97 2:06 PM ]
2 ;;2.0;CMOP;;11 Apr 97
3RECOM1 ;Gets last month that is compiled with monthly data. (3 months ago)
4 ;E.g. Today=11/3/94, 8/94 is last date to be compiled with monthly data.
5 S PSXMON=$E(DT,4,5),PSXMON=$P("10^11^12^01^02^03^04^05^06^07^08^09","^",PSXMON) S PSXYR=$S(+PSXMON>9:($E(DT,1,3)-1),1:$E(DT,1,3)),PSXCUT=PSXYR_PSXMON_"00"
6 ;If PSXBEG's yr & mon > 2 mons ago, set PSXBEG to 3 months ago & queue
7 ;monthly data. Then set 2 months ago to PSXEND & compile daily data.
8 I $E(PSXBEG,1,5)<$E(PSXCUT,1,5) S PSXBDT=PSXBEG,PSXEDT=$S($E(PSXEND,1,5)<$E(PSXCUT,1,5):PSXEND,1:PSXCUT),PSXCOM=0 D QUE^PSXCST Q:$G(PSXERR) G:PSXEND=PSXEDT END^PSXCSUTL D Q:$G(PSXERR)
9 .S PSXBDT=$S($E(PSXCUT,4,5)=12:$E(PSXCUT,1,3)+1,1:$E(PSXCUT,1,3))_$P("02^03^04^05^06^07^08^09^10^11^12^01","^",$E(PSXCUT,4,5))_"01",PSXEDT=PSXEND,PSXCOM=2 D QUE^PSXCST
10 ;If PSXBEG's yr & mon are 3 months ago, send PSXBEG's month for monthly
11 ;compile. If PSXEND is not same yr & mon as PSXBEG, send 2 months ago to
12 ;PSXEND for daily compile.
13 I $E(PSXBEG,1,5)=$E(PSXCUT,1,5) S (PSXBDT,PSXEDT)=PSXCUT,PSXCOM=0 D QUE^PSXCST Q:$G(PSXERR) D
14 .Q:$E(PSXBEG,1,5)=$E(PSXEND,1,5)
15 .S PSXNEXT=$S($E(PSXCUT,4,5)=12:$E(PSXCUT,1,3)+1,1:$E(PSXCUT,1,3))_$P("02^03^04^05^06^07^08^09^10^11^12^01","^",$E(PSXCUT,4,5))
16 .S PSXBDT=PSXNEXT_"00",PSXEDT=PSXEND,PSXCOM=2 D QUE^PSXCST Q:$G(PSXERR)
17 ;If PSXBEG is before monthly data should be compiled, send PSXBEG to
18 ;PSXEND for daily compilation.
19 I $E(PSXBEG,1,5)>$E(PSXCUT,1,5) S PSXBDT=PSXBEG,PSXEDT=PSXEND,PSXCOM=2 D QUE^PSXCST Q:$G(PSXERR)
20 G END^PSXCSUTL
Note: See TracBrowser for help on using the repository browser.