source: FOIAVistA/tag/r/PROSTHETICS-RMPR-RMPO-RMPS/RMPR5HQC.m@ 1607

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

initial load of FOIAVistA 6/30/08 version

File size: 4.7 KB
Line 
1RMPR5HQC ;HCIOFO/RVD - NPPD LINE USAGE REPORT FOR HQ ; 06 OCT 00
2 ;;3.0;PROSTHETICS;**51,61**;Feb 09, 1996
3DQ1 ;print PIP Report
4 F RST=0:0 S RST=$O(^TMP($J,R5,RST)) Q:RST'>0 D:(RSTA'="")&(RSTA'=RST)&(RPR=1) HDRL S RSTA=RST F RI=0:0 S RI=$O(^TMP($J,R5,RST,RI)) D:(RGRP'="")&(RGRP'=RI) SUMG1 Q:$G(RFL)!(RI'>0) D
5 .D:RPR=0 HDRL
6 .S RGRP=RI
7 .S RNPGRP=RMARRAY(RI)
8 .S RJ=""
9 .F S RJ=$O(^TMP($J,R5,RST,RI,RJ)) Q:$G(RFL) D:(RLINE'="")&(RLINE'=RJ) SUML1 Q:RJ="" D
10 ..S RLINE=RJ,RNPLINE=$$NPLIN^RMPR5HQ5(RJ)
11 ..I RGCNT=0 S RGCNT=RGCNT+1
12 ..S RK="" F S RK=$O(^TMP($J,R5,RST,RI,RJ,RK)) Q:$G(RFL)!(RK="") D
13 ...S RL=""
14 ...F S RL=$O(^TMP($J,R5,RST,RI,RJ,RK,RL)) Q:$G(RFL)!(RL="") D
15 ....I RLCNT=0 D GLN1
16 ....S RLCNT=RLCNT+1
17 ....S RDAT=^TMP($J,R5,RST,RI,RJ,RK,RL)
18 ....S RMVA=$P(RDAT,U,1)
19 ....S RMCOM=$P(RDAT,U,2)
20 ....S RMUSE=$P(RDAT,U,3)
21 ....S RMISU=$P(RDAT,U,4)
22 ....S RMISN=$P(RDAT,U,5)
23 ....S RMAVEN=$P(RDAT,U,6)
24 ....S RMDLEN=$P(RDAT,U,7)
25 ....S RMQOHU=$P(RDAT,U,8)
26 ....S RMQOHN=$P(RDAT,U,9)
27 ....S RMVALU=$P(RDAT,U,10)
28 ....S RMVALN=$P(RDAT,U,11)
29 ....S RMAVEU=$P(RDAT,U,12)
30 ....S RMDLEU=$P(RDAT,U,13)
31 ....;total for GROUP
32 ....S RMTVAG=RMTVAG+RMVA
33 ....S RMTCOMG=RMTCOMG+RMCOM
34 ....S RMTUSEG=RMTUSEG+RMVA+RMCOM
35 ....S RMTISUG=RMTISUG+RMISU
36 ....S RMTISNG=RMTISNG+RMISN
37 ....S RMTDLEG=RMTDLEG+RMDLEU+RMDLEN
38 ....S RMTQOHUG=RMTQOHUG+RMQOHU
39 ....S RMTQOHNG=RMTQOHNG+RMQOHN
40 ....S RMTVALUG=RMTVALUG+RMVALU
41 ....S RMTVALNG=RMTVALNG+RMVALN
42 ....S RMGTOU=RMGTOU+RMVALU
43 ....S RMGTON=RMGTON+RMVALN
44 ....S RMGTIU=RMGTIU+RMISU
45 ....S RMGTIN=RMGTIN+RMISN
46 ....;total for line item
47 ....S RMTVAL=RMTVAL+RMVA
48 ....S RMTCOML=RMTCOML+RMCOM
49 ....I (RMCOM'=""),$G(RMCOM) S RMTUSELN=RMTUSELN+RMCOM
50 ....I (RMVA'=""),$G(RMVA) S RMTUSELU=RMTUSELU+RMVA
51 ....S RMTISUL=RMTISUL+RMISU
52 ....S RMTISNL=RMTISNL+RMISN
53 ....S RMTQOHUL=RMTQOHUL+RMQOHU
54 ....S RMTQOHNL=RMTQOHNL+RMQOHN
55 ....S RMTVALUL=RMTVALUL+RMVALU
56 ....S RMTVALNL=RMTVALNL+RMVALN
57 ....S (RPRINT,RPR)=1
58 Q
59 ;
60HDRL ;print heading.
61 D CNTRX^RMPR5HQA S ^TMP($J,"RI",RC)=""
62 I RPR=1 D CNTRX^RMPR5HQA S ^TMP($J,"RI",RC)=RES
63 D CNTRX^RMPR5HQA S ^TMP($J,"RI",RC)=""
64 S RPR=1
65 S RSTN=$$STN(RSTA)
66 D CNTRX^RMPR5HQA
67 S ^TMP($J,"RI",RC)="PROSTHETIC INVENTORY NPPD GROUP/LINE REPORT"_RB10_"Run Date: "_RMRDATE
68 D CNTRX^RMPR5HQA S ^TMP($J,"RI",RC)="STATION: "_$E(RSTN,1,30)_RB6_RMBD_" - "_RMED_" [ "_RMCALDAY_" calendar days ]"
69 Q
70 ;
71GLN1 ;print NPPD GROUP and LINE header.
72 D CNTRX^RMPR5HQA S ^TMP($J,"RI",RC)=""
73 D CNTRX^RMPR5HQA S ^TMP($J,"RI",RC)=""
74 D CNTRX^RMPR5HQA S ^TMP($J,"RI",RC)=RNPGRP
75 D LBL1^RMPR5HQA
76 Q
77 ;
78SUML1 ;
79 D CNTRX^RMPR5HQA S ^TMP($J,"RI",RC)=RLINE_RB1_RNPLINE
80 S:$G(RMTUSELU) RMTAVELU=RMTUSELU/RMCALDAY
81 S:$G(RMTUSELN) RMTAVELN=RMTUSELN/RMCALDAY
82 S:$G(RMTUSELU) RTDLELA=RMTQOHUL/RMTAVELU
83 S:$G(RMTUSELN) RTDLELC=RMTQOHNL/RMTAVELN
84 S RTDLELA=$S(RTDLELA>999:">999",1:$J(RTDLELA,5,0))
85 S RTDLELC=$S(RTDLELC>999:">999",1:$J(RTDLELC,5,0))
86 S:RMTQOHNL=0 RTDLELC=""
87 S:RMTQOHUL=0 RTDLELA=""
88 S:(RMTQOHNL>0)&(RMTCOML<1) RTDLELC=">"_RMCALDAY
89 S:(RMTQOHUL>0)&(RMTVAL<1) RTDLELA=">"_RMCALDAY
90 S RMTAVEG=RTAVELA+RTAVELC
91 D CNTRX^RMPR5HQA
92 S ^TMP($J,"RI",RC)=" (Used)"_RB13_$J(RMTVAL,5)_RB1_$J($FN(RMTISUL,",",2),9)_RB1_"|"_RB18_"|"_RB1_$J(RMTUSELU,5)_RB1_"|"_RB1_$J(RMTAVELU,8,2)_RB1_"|"
93 S ^TMP($J,"RI",RC)=^TMP($J,"RI",RC)_RB1_$J(RMTQOHUL,6)_RB8_"|"_RB1_$J(RTDLELA,6)_RB1_"|"_RB1_$J($FN(RMTVALUL,",",2),11)
94 ;next two lines print new total
95 D CNTRX^RMPR5HQA
96 S ^TMP($J,"RI",RC)=" (New)"_RB30_"|"_RB1_$J(RMTCOML,6)_RB1_$J($FN(RMTISNL,",",2),9)_RB1_"|"_RB1_$J(RMTUSELN,5)_RB1_"|"_RB1_$J(RMTAVELN,8,2)_RB1_"|"
97 S ^TMP($J,"RI",RC)=^TMP($J,"RI",RC)_RB6_$J(RMTQOHNL,8)_RB1_"|"_RB1_$J(RTDLELC,6)_RB1_"|"_RB12_$J($FN(RMTVALNL,",",2),11)
98 ;
99 S (RMTVAL,RMTISUL,RMTCOML,RMTISNL,RMTUSELU,RMTAVELU,RMTAVELN,RMTQOHUL,RMTQOHNL,RMTVALUL,RMTVALNL)=0
100 S (RMTUSELN,RMTUSELU,RTDLELA,RTDLELC,RTAVELA,RTAVELC)=0
101 S (RNPLINE,RLINE)=""
102 Q
103 ;
104SUMG1 ;print summary total for NPPD GROUP
105 D CNTRX^RMPR5HQA S ^TMP($J,"RI",RC)=REQ
106 D CNTRX^RMPR5HQA
107 S ^TMP($J,"RI",RC)=RB24_$J(RMTVAG,5)_RB1_$J($FN(RMTISUG,",",2),9)_RB1_"|"_RB1_$J(RMTCOMG,6)_RB1_$J($FN(RMTISNG,",",2),9)_RB1_"|"_RB1_$J(RMTUSEG,5)_RB1_"|"_RB10_"|"
108 S ^TMP($J,"RI",RC)=^TMP($J,"RI",RC)_RB1_$J(RMTQOHUG,6)_RB1_$J(RMTQOHNG,6)_RB1_"|"_RB8_"|"_RB1_$J($FN(RMTVALUG,",",2),11)_$J($FN(RMTVALNG,",",2),11)
109 ;W !,?26,$J(RMTVAG,5),?34,$J($FN(RMTISUG,",",2),6),?40,"|",?41,$J(RMTCOMG,4),?49,$J($FN(RMTISNG,",",2),9),?59,"|",?60,$J(RMTUSEG,5),?67,"|",?78,"|"
110 ;W ?81,$J(RMTQOHUG,5),?87,$J(RMTQOHNG,6),?94,"|",?103,"|",?104,$J($FN(RMTVALUG,",",2),11),?116,$J($FN(RMTVALNG,",",2),11)
111 ;
112 S (RMTVAG,RMTISUG,RMTCOMG,RMTISNG,RMTUSEG,RMTAVEG,RMTQOHUG,RMTQOHNG,RMTVALUG,RMTVALNG,RLCNT)=0
113 S (RNPGRP,RGRP)=""
114 Q
115 ;
116STN(RST) ;STATION FUNCTION
117 N Y,RS
118 S RS=$O(^RMPR(669.9,"C",RST,0)),Y=$P(^RMPR(669.9,RS,0),U,1)
119 Q Y
Note: See TracBrowser for help on using the repository browser.