source: WorldVistAEHR/trunk/r/CMOP-PSX/PSXCSLOG.m@ 1437

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

initial load of WorldVistAEHR

File size: 3.6 KB
Line 
1PSXCSLOG ;BIR/JMB-Checks for Active Cost Tasks Before Queuing/View Cost Task Log ;[ 04/08/97 2:06 PM ]
2 ;;2.0;CMOP;;11 Apr 97
3CHECK ;Looks for jobs queued or running for same or overlapping date range.
4 Q:'$D(^PSX(554,"ARUN")) K PSXLOC S $P(PSXSLN,"-",80)=""
5 F PSXSTA=-1:0 S PSXSTA=$O(^PSX(554,"ARUN",PSXSTA)) Q:PSXSTA="" F PSXIEN=0:0 S PSXIEN=$O(^PSX(554,"ARUN",PSXSTA,PSXIEN)) Q:'PSXIEN D
6 .Q:'$D(^PSX(554,1,2,PSXIEN,0))
7 .I PSXBDT'<$P(^PSX(554,1,2,PSXIEN,0),"^",3)&(PSXEDT'>$P(^PSX(554,1,2,PSXIEN,0),"^",4)) S PSXLOC(PSXIEN)="" Q
8 .I PSXBDT'>$P(^PSX(554,1,2,PSXIEN,0),"^",3)&(PSXEDT'>$P(^PSX(554,1,2,PSXIEN,0),"^",4))&(PSXEDT'<$P(^PSX(554,1,2,PSXIEN,0),"^",3)) S PSXLOC(PSXIEN)="" Q
9 .I PSXBDT'<$P(^PSX(554,1,2,PSXIEN,0),"^",3)&(PSXBDT'>$P(^PSX(554,1,2,PSXIEN,0),"^",4))&(PSXEDT'<$P(^PSX(554,1,2,PSXIEN,0),"^",4)) S PSXLOC(PSXIEN)="" Q
10 .I PSXBDT'<$P(^PSX(554,1,2,PSXIEN,0),"^",3)&(PSXEDT'>$P(^PSX(554,1,2,PSXIEN,0),"^",4)) S PSXLOC(PSXIEN)="" Q
11 .Q:+$G(PSXCOM)
12 .S PSXBDTE=$E($P(^PSX(554,1,2,PSXIEN,0),"^",3),1,5),PSXEDTE=$E($P(^PSX(554,1,2,PSXIEN,0),"^",4),1,5)
13 .I ($E(PSXBDT,1,5)'<PSXBDTE&($E(PSXBDT,1,5)'>PSXEDTE))!($E(PSXEDT,1,5)'<PSXBDTE&($E(PSXEDT,1,5)'>PSXEDTE)) S PSXLOC(PSXIEN)="" W !,"OH NO!"
14 Q:'$O(PSXLOC(0))
15 ;Error msg
16 W !!,"Your task cannot be queued. The following active task(s) is for the same",!,"date range you have selected or for dates that overlap your date range.",!! S PSXERR=1,$P(PSXSLN,"-",57)=""
17 W "Status Activity Data Date Range Task# Task Started",!,PSXSLN
18 F PSXIEN=0:0 S PSXIEN=$O(PSXLOC(PSXIEN)) Q:'PSXIEN D DISP
19 Q
20VIEW ;Displays cost entries in 554
21 I '$O(^PSX(554,1,2,0)) W !!,"There are no cost entries in the CMOP OPERATIONS file." G EXIT
22 S $P(PSXSLN,"-",80)="",(PSXOUT,PSXPAGE)=0,PSXFIRST=$O(^PSX(554,1,2,0)),PSXFIRST=$$FMTE^XLFDT($P($P($G(^PSX(554,1,2,PSXFIRST,0)),"^"),"."))
23 F PSXIEN=0:0 S PSXIEN=$O(^PSX(554,1,2,PSXIEN)) Q:'PSXIEN S PSXLAST=PSXIEN
24 S PSXLAST=$$FMTE^XLFDT($P($P($G(^PSX(554,1,2,PSXLAST,0)),"^"),".")) D HD
25 F PSXIEN=0:0 S PSXIEN=$O(^PSX(554,1,2,PSXIEN)) Q:'PSXIEN D:$Y+3>IOSL HD D:'PSXOUT DISP Q:PSXOUT
26EXIT K PSXBDT,PSXBY,PSXEDT,PSXEND,PSXFIRST,PSXIEN,PSXLAST,PSXNODE,PSXOUT,PSXPAGE,PSXSTART
27 Q
28DISP ;Displays one entry in cost task log.
29 Q:'$D(^PSX(554,1,2,PSXIEN,0)) S PSXNODE=^(0)
30 W !,$S('+$P(PSXNODE,"^",2):"Queued",+$P(PSXNODE,"^",2)=1:"Running",+$P(PSXNODE,"^",2)=2:"Complete",1:"Unknown")
31 W ?10,$S($P(PSXNODE,"^",6)="C":"Compile",$P(PSXNODE,"^",6)="P":"Purge",1:"Unknown")
32 S PSXBDT=$P(PSXNODE,"^",3),PSXEDT=$P(PSXNODE,"^",4)
33 W ?18,$E(PSXBDT,4,5)_$S(+$E(PSXBDT,6,7):"/"_$E(PSXBDT,6,7),1:"")_"/"_$E(PSXBDT,2,3)_"-"_$E(PSXEDT,4,5)_$S(+$E(PSXEDT,6,7):"/"_$E(PSXEDT,6,7),1:"")_"/"_$E(PSXEDT,2,3),?36,$P(PSXNODE,"^",8)
34 S PSXSTART=$P(PSXNODE,"^"),PSXEND=$P(PSXNODE,"^",7) W ?43,$E($P(PSXSTART,"."),4,5)_"/"_$E($P(PSXSTART,"."),6,7)_"/"_$E($P(PSXSTART,"."),2,3)_"@"_$E($P(PSXSTART,".",2),1,4)
35 I $L($E($P(PSXSTART,".",2),1,4))<4 F PSXI=$L($E($P(PSXSTART,".",2),1,4)):1:3 W 0
36 I +PSXEND W ?57,$E($P(PSXEND,"."),4,5)_"/"_$E($P(PSXEND,"."),6,7)_"/"_$E($P(PSXEND,"."),2,3)_"@"_$E($P(PSXEND,".",2),1,4) D
37 .I $L($E($P(PSXEND,".",2),1,4))<4 F PSXI=$L($E($P(PSXEND,".",2),1,4)):1:3 W 0
38 .W ?71,$$FMDIFF^XLFDT(PSXEND,PSXSTART,3)
39 S PSXBY=$S(+$P(PSXNODE,"^",5):$P($G(^VA(200,+$P(PSXNODE,"^",5),0)),"^"),1:"UNKNOWN")
40 W !?18,"Queued by: "_PSXBY,!
41 Q
42HD S PSXPAGE=PSXPAGE+1
43 I PSXPAGE>1 K DIR S DIR(0)="E" D ^DIR K DIR I $G(DTOUT)!($G(DUOUT)) S PSXOUT=1 Q
44 W @IOF,!?11,"CONSOLIDATED MAIL OUTPATIENT PHARMACY COST ACTIVITY SUMMARY",!?23,"From "_PSXFIRST_" thru "_PSXLAST,!!
45 W "Status Activity Data Date Range Task# Task Started Task Ended Task Time",!,PSXSLN
46 Q
Note: See TracBrowser for help on using the repository browser.