source: FOIAVistA/tag/r/PROSTHETICS-RMPR-RMPO-RMPS/RMPR5HQG.m@ 1154

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

initial load of FOIAVistA 6/30/08 version

File size: 3.9 KB
Line 
1RMPR5HQG ;HCIOFO/RVD - NPPD GROUP USAGE REPORT ; 15 AUG 00
2 ;;3.0;PROSTHETICS;**51**;Feb 09, 1996
3 ;
4 ; HNC - added grand totals
5 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
6DQ1 ;print PIP Report
7 ;$O the ^TMP( global for all the records
8 ;print all records based on the sort criteria given.
9 I IOST["C-" W @IOF
10 ;
11 F RST=0:0 S RST=$O(^TMP($J,R5,RST)) Q:RST'>0 S RSTN=$$STN^RMPR5HQL(RST),RPR=0 F RI=0:0 S RI=$O(^TMP($J,R5,RST,RI)) Q:$G(RFL) D:(RGRP'="")&(RGRP'=RI) SUMG1 Q:RI'>0 D
12 .D:RPR=0 HDRG
13 .S RGRP=RI
14 .S RNPGRP=RMARRAY(RI)
15 .S RJ=""
16 .F S RJ=$O(^TMP($J,R5,RST,RI,RJ)) Q:$G(RFL) Q:RJ="" D
17 ..S RLINE=RJ,RNPLINE=$$NPLIN^RMPR5HQ5(RJ)
18 ..S RK="" F S RK=$O(^TMP($J,R5,RST,RI,RJ,RK)) Q:$G(RFL)!(RK="") D
19 ...S RL=""
20 ...F S RL=$O(^TMP($J,R5,RST,RI,RJ,RK,RL)) Q:$G(RFL)!(RL="") D
21 ....I RLCNT=0 D GLN1
22 ....S RLCNT=RLCNT+1
23 ....S RDAT=^TMP($J,R5,RST,RI,RJ,RK,RL)
24 ....S RMVA=$P(RDAT,U,1)
25 ....S RMCOM=$P(RDAT,U,2)
26 ....S RMUSE=$P(RDAT,U,3)
27 ....S RMISU=$P(RDAT,U,4)
28 ....S RMISN=$P(RDAT,U,5)
29 ....S RMAVEN=$P(RDAT,U,6)
30 ....S RMDLEN=$P(RDAT,U,7)
31 ....S RMQOHU=$P(RDAT,U,8)
32 ....S RMQOHN=$P(RDAT,U,9)
33 ....S RMVALU=$P(RDAT,U,10)
34 ....S RMVALN=$P(RDAT,U,11)
35 ....S RMAVEU=$P(RDAT,U,12)
36 ....S RMDLEU=$P(RDAT,U,13)
37 ....S RMGISUG=RMGISUG+RMISU
38 ....S RMGISNG=RMGISNG+RMISN
39 ....;
40 ....S RMGTIU=RMGTIU+RMISU
41 ....S RMGTIN=RMGTIN+RMISN
42 ....;
43 ....S RMGTOU=RMGTOU+RMVALU
44 ....S RMGTON=RMGTON+RMVALN
45 ....;total for GROUP
46 ....I (RMCOM'=""),$G(RMCOM) S RTUSEGC=RTUSEGC+RMCOM
47 ....I (RMVA'=""),$G(RMVA) S RTUSEGA=RTUSEGA+RMVA
48 ....S RMTVAG=RMTVAG+RMVA
49 ....S RMTCOMG=RMTCOMG+RMCOM
50 ....S RMTISUG=RMTISUG+RMISU
51 ....S RMTISNG=RMTISNG+RMISN
52 ....S RMTQOHUG=RMTQOHUG+RMQOHU
53 ....S RMTQOHNG=RMTQOHNG+RMQOHN
54 ....S RMTVALUG=RMTVALUG+RMVALU
55 ....S RMTVALNG=RMTVALNG+RMVALN
56 ....S (RPRINT,RPR)=1
57 ....I $Y+8>IOSL,IOST["C-" K DIR S DIR(0)="E" D ^DIR S:+Y'>0 RFL=1 Q:+Y'>0 W @IOF D HDRG,LBL1^RMPR5HQ2
58 ....I $Y+8>IOSL,IOST'["C-" W @IOF D HDRG,LBL1^RMPR5HQ2
59 I '$G(RPRINT) W !!,"No Records to Print !!" Q
60 Q:$G(RFL)
61 W !!,REQ
62 S RMGTOT=RMGTOU+RMGTON
63 W !!,?10,"GRAND TOTAL $ VALUE ISSUED (Used) = ",?38,"$",$J($FN(RMGISUG,",",2),10)
64 W ?80,"GRAND TOTAL $ VALUE ON-HAND (Used) = ",?115,"$",$J($FN(RMGTOU,",",2),12)
65 W !,?10,"GRAND TOTAL $ VALUE ISSUED (New) = ",?38,"$",$J($FN(RMGISNG,",",2),10)
66 W ?80,"GRAND TOTAL $ VALUE ON-HAND (New) = ",?115,"$",$J($FN(RMGTON,",",2),12)
67 ;W !,?80,"GRAND TOTAL $ VALUE ON-HAND = ",?68,"$"_$J($FN(RMGTOT,",",2),12)
68 W !,"<End of Report>"
69 Q
70 ;
71HDRG ;print heading.
72 Q:$G(RFL)
73 S RMPAGE=RMPAGE+1
74 W !,"PROSTHETIC INVENTORY NPPD GROUP REPORT",?50,"Run Date: ",RMRDATE,?100,"Page: ",RMPAGE
75 W !,"STATION: ",$E(RSTN,1,20)
76 W ?32,RMBD," - ",RMED," [ ",RMCALDAY," calendar days ]"
77 Q
78 ;
79GLN1 ;print NPPD GROUP and LINE header.
80 W !!,"ENTIRE SUMMARY"
81 D LBL1^RMPR5HQ2
82 Q
83 ;
84SUMG1 ;print summary total for NPPD GROUP
85 Q:$G(RFL)
86 W !,RLN
87 W !,RGRP," ",RNPGRP
88 S:$G(RTUSEGA) RTAVEGA=RTUSEGA/RMCALDAY
89 S:$G(RTUSEGC) RTAVEGC=RTUSEGC/RMCALDAY
90 S:$G(RTUSEGA) RTDLEGA=RMTQOHUG/RTAVEGA
91 S:$G(RTUSEGC) RTDLEGC=RMTQOHNG/RTAVEGC
92 S RTDLEGA=$S(RTDLEGA>999:">999",1:$J(RTDLEGA,5,0))
93 S RTDLEGC=$S(RTDLEGC>999:">999",1:$J(RTDLEGC,5,0))
94 S:RMTQOHNG=0 RTDLEGC=""
95 S:RMTQOHUG=0 RTDLEGA=""
96 S:(RMTQOHNG>0)&(RMTCOMG<1) RTDLEGC=">"_RMCALDAY
97 S:(RMTQOHUG>0)&(RMTVAG<1) RTDLEGA=">"_RMCALDAY
98 ;next 2 lines for used:
99 W !,?5,"(Used)",?26,$J(RMTVAG,5),?34,$J($FN(RMTISUG,",",2),6),?40,"|",?59,"|",?60,$J(RTUSEGA,5),?67,"|",?71,$J(RTAVEGA,5,2),?78,"|"
100 W ?81,$J(RMTQOHUG,5),?94,"|",?97,$J(RTDLEGA,6),?103,"|",?104,$J($FN(RMTVALUG,",",2),11)
101 ;next 2 lines for new:
102 W !,?5,"(New)",?40,"|",?41,$J(RMTCOMG,4),?49,$J($FN(RMTISNG,",",2),9),?59,"|",?60,$J(RTUSEGC,5),?67,"|",?71,$J(RTAVEGC,5,2),?78,"|"
103 W ?87,$J(RMTQOHNG,6),?94,"|",?97,$J(RTDLEGC,6),?103,"|",?116,$J($FN(RMTVALNG,",",2),11)
104 S (RMTVAG,RMTISUG,RMTCOMG,RMTISNG,RTUSEGA,RTUSEGC,RTAVEGA,RTAVEGC,RMTQOHUG,RMTQOHNG,RTDLEGA,RTDLEGC,RMTVALUG,RMTVALNG)=0
105 S (RNPGRP,RGRP)=""
106 Q
Note: See TracBrowser for help on using the repository browser.