source: WorldVistAEHR/trunk/r/PROSTHETICS-RMPR-RMPO-RMPS/RMPR5N4.m@ 1111

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

initial load of WorldVistAEHR

File size: 4.1 KB
RevLine 
[613]1RMPR5N4 ;HIN/RVD-PRINT LAB ITEM SUMMARY BY EMPLOYEE ;3/13/1998
2 ;;3.0;PROSTHETICS;**33,37**;Feb 09, 1996
3EN N RMEMP D DIV4^RMPRSIT
4 K ^TMP($J),RMPRFLG,RMPRI S RMPREND=0 D HOME^%ZIS G:$D(X) EXIT1
5 S DIC="^VA(200,",DIC(0)="MAEQ"
6EN1 R !!,"Enter 'ALL' for all Lab Employees or 'RETURN' to select individual names: ",RMENTER:DTIME G:$D(DTOUT)!$D(DUOUT)!(RMENTER="^") EXIT1
7 G:RMENTER["?" EN1
8 S X=RMENTER X ^%ZOSF("UPPERCASE") S RMENTER=Y I RMENTER="ALL" S RMPRI(0)=1 G CONT
9 W ! F EMP=1:1 S DIC("A")="Select EMPLOYEE "_EMP_": " D ^DIC G:$D(DTOUT)!(X["^")!(X=""&(EMP=1)) EXIT1 Q:X="" D
10 .S RMEMP=$P(^VA(200,+Y,0),U,1) Q:RMEMP=""
11 .I $D(RMPRI(RMEMP)) W $C(7)," ??",?40,"..Duplicate employee name" S EMP=EMP-1 Q
12 .S RMPRI(RMEMP)=+Y
13CONT G:'$D(RMPRI) EXIT1 S RMPRCOUN=0 W !! S %DT("A")="Beginning Date: ",%DT="AEPX",%DT("B")="T-30" D ^%DT S RMPRBDT=Y G:Y<0 EXIT1
14ENDATE S %DT("A")="Ending Date: ",%DT="AEX",%DT("B")="TODAY" D ^%DT G:Y<0 EXIT1 I RMPRBDT>Y W !,$C(7),"Invalid Date Range Selection!!" G ENDATE
15 G:Y<0 EXIT1 S RMPREDT=Y,Y=RMPRBDT D DD^%DT S RMPRX=Y,Y=RMPREDT D DD^%DT S RMPRY=Y
16 S %ZIS="MQ" K IOP D ^%ZIS G:POP EXIT1
17 I '$D(IO("Q")) U IO G PRINT
18 K IO("Q") S ZTDESC="PROS LAB ITEM SUMMARY",ZTRTN="PRINT^RMPR5N4",ZTIO=IO,ZTSAVE("RMPRBDT")="",ZTSAVE("RMPREDT")="",ZTSAVE("RMPRI(")="",ZTSAVE("RMPRX")="",ZTSAVE("RMPRY")="",ZTSAVE("RMPR(""STA"")")="",ZTSAVE("RMPR(")=""
19 D ^%ZTLOAD W:$D(ZTSK) !,"REQUEST QUEUED!" H 1 G EXIT1
20PRINT I $E(IOST)["C" W !!,"Processing report......"
21 ;ENTRY POINT FOR PRINTING REPORT
22 W:$E(IOST)["C" @IOF S RMPAGE=1,RMPREND=0 D:$D(RMPRI(0)) ALL
23 I '$D(RMPRI) D NONEALL G EXIT
24 ;D HEAD
25 S RMD="" F S RMD=$O(RMPRI(RMD)) Q:RMD="" S RMI=RMPRI(RMD) D PRI1
26 G:RMPREND EXIT D WRI D:'$D(^TMP($J)) NONEALL G EXIT
27 ;
28PRI1 F RO=0:0 S RO=$O(^RMPR(661.2,"F",RMI,RO)) Q:(RO'>0)!(RMPREND) D REST
29 D:'$D(^TMP($J,RMD))&'$D(RMPRI(0)) NONE
30 Q
31 ;
32EXIT ;Exit
33 ;I RMPRCOUN>0,$D(RMPREDT),'$D(KILL) D W !!?32,"END OF REPORT"
34 ;I $E(IOST)["C"&($Y<22) F W ! Q:$Y>20
35 I $D(RMPREDT),$E(IOST)["C",'$D(DUOUT),'$D(DTOUT),'RMPREND K DIR S DIR(0)="E" D ^DIR
36EXIT1 ;
37 D ^%ZISC
38 N RMPR,RMPRSITE D KILL^XUSCLEAN
39 Q
40 ;
41HEAD ;write heading
42 W !,?18,"PROSTHETICS LAB ITEM SUMMARY BY EMPLOYEE",?64,"Page: ",RMPAGE
43 W !,RMPRX," to ",RMPRY
44 S RMPAGE=RMPAGE+1
45 Q
46HEAD1 I $E(IOST)["C"&($Y>(IOSL-7)) S DIR(0)="E" D ^DIR S:$D(DTOUT)!(Y=0) RMPREND=1 Q:RMPREND W @IOF D HEAD
47 I $E(IOST)'["C"&($Y>(IOSL-6)) W @IOF D HEAD
48 W !,RMPR("L"),!,"Employee: ",I
49 W !," DATE",?17,"ITEM",?43,"HCPCS",?51,"TIME SPENT(hr)",?68,"LABOR COST"
50 W !," ----",?17,"----",?43,"-----",?51,"--------------",?68,"----------"
51 S RMPRFLG=1
52 Q
53 ;
54SUM W !,?53,"--------",?70,"--------",!,?39,"***TOTALS =",?53,$J(RMTITOT,7,2),?67,$J(RMDOTOT,10,2),!
55 W @IOF K RMPRFLG
56 Q
57 ;
58REST Q:'$D(^RMPR(661.2,RO,1))
59 S RM20=$G(^RMPR(661.2,RO,0)),RMDAT=$P(RM20,U,1)
60 Q:(RMDAT<RMPRBDT)!(RMDAT>RMPREDT)
61 S ^TMP($J,RMD,RO)=RMDAT
62 Q
63WRI ;
64 ;S RMD="" F S RMD=$O(RMPRI(RMD)) Q:RMD=""
65 ;
66 S I="" F S I=$O(^TMP($J,I)) Q:I="" Q:RMPREND S (RMDOTOT,RMTITOT,RMSUF)=0 F J=0:0 S J=$O(^TMP($J,I,J)) Q:RMPREND D:J'>0 SUM Q:J'>0 D
67 .S RMSUF=1
68 .I '$D(RMPRFLG) D HEAD,HEAD1
69 .S RMDAT=^TMP($J,I,J)
70 .S RM20=$G(^RMPR(661.2,J,0)),RM21=$G(^RMPR(661.2,J,1))
71 .S RMPAT=$P(RM20,U,2)
72 .S RMIT=$P(RM20,U,9)
73 .S RMDAHC=$P(RM20,U,4)
74 .S RMDAIT=$P(RMIT,"-",2)
75 .Q:'RMDAHC
76 .S:RMDAIT RM1=$P($G(^RMPR(661.1,RMDAHC,3,RMDAIT,0)),U,1)
77 .S:'RMDAIT RM1=$P($G(^RMPR(661.1,RMDAHC,0)),U,2) Q:RM1=""
78 .S RMHCPC=$P(^RMPR(661.1,RMDAHC,0),U,1)
79 .S RMITEM=$E($P(RM1,U,1),1,31)
80 .S RMHOUR=$P(RM21,U,1),RMDOL=$P(RM21,U,2)
81 .S RMDAT=$E(RMDAT,4,5)_"/"_$E(RMDAT,6,7)_"/"_$E(RMDAT,2,3)
82 .W !,RMDAT,?11,RMITEM,?43,RMHCPC,?56,$J(RMHOUR,4,2),?70,$J(RMDOL,7,2)
83 .S:RMDOL RMDOTOT=RMDOTOT+RMDOL
84 .S:RMHOUR RMTITOT=RMTITOT+RMHOUR
85 .S RMPRFLG=1
86 .I $E(IOST)["C"&($Y>(IOSL-7)) S DIR(0)="E" D ^DIR S:$D(DTOUT)!(Y=0) RMPREND=1 Q:RMPREND W @IOF D HEAD,HEAD1 Q
87 .I $Y>(IOSL-6) W @IOF D HEAD,HEAD1 S RMPRFLG=1
88 Q
89 ;
90ALL ;process all lab employees.
91 S RMEMP=""
92 F I=0:0 S I=$O(^RMPR(661.2,"F",I)) Q:I'>0 S RMEMP=$P(^VA(200,I,0),U,1) S RMPRI(RMEMP)=I
93 Q
94 ;
95NONE ;No data for certain employee
96 W !,RMPR("L"),!,"No Lab data for Employee: ",RMD," ....for this date range !!!"
97 Q
98NONEALL W !!,"NO DATA FOR THIS DATE RANGE!!!"
99 Q
Note: See TracBrowser for help on using the repository browser.