source: FOIAVistA/tag/r/PROSTHETICS-RMPR-RMPO-RMPS/RMPR5HQH.m@ 896

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

initial load of FOIAVistA 6/30/08 version

File size: 3.9 KB
Line 
1RMPR5HQH ;HCIOFO/RVD - HCPCS USAGE REPORT ; 15 AUG 00
2 ;;3.0;PROSTHETICS;**51**;Feb 09, 1996
3 ;
4DQ1 ;print PIP Report
5 ;$O the ^TMP( global for all the records
6 ;print all records based on the sort criteria given.
7 I IOST["C-" W @IOF
8 ;
9 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) Q:RI'>0 D
10 .D:RPR=0 HDRH
11 .S RNPGRP=RMARRAY(RI)
12 .S RJ=""
13 .F S RJ=$O(^TMP($J,R5,RST,RI,RJ)) Q:$G(RFL) D:(RLINE'="")&(RLINE'=RJ) SUML1^RMPR5HQ2 Q:RJ="" D
14 ..S RLINE=RJ,RNPLINE=$$NPLIN^RMPR5HQ5(RJ)
15 ..I RGCNT=0 S RGCNT=RGCNT+1
16 ..S RK="" F S RK=$O(^TMP($J,R5,RST,RI,RJ,RK)) Q:$G(RFL) D:(RHCPC'="")&(RHCPC'=RK)&(RLCNT'=0) SUMH1 Q:RK="" D
17 ...S RHCPC=RK
18 ...S RL=""
19 ...F S RL=$O(^TMP($J,R5,RST,RI,RJ,RK,RL)) Q:$G(RFL)!(RL="") D
20 ....S RHCPC=$P(RK,"/",1)
21 ....S RMHCDA=$P(RK,"/",2)
22 ....S RNPITEM=$P($G(^RMPR(661.1,RMHCDA,0)),U,2)
23 ....I RLCNT=0 D GLN1
24 ....S RLCNT=RLCNT+1
25 ....S RDAT=^TMP($J,R5,RST,RI,RJ,RK,RL)
26 ....S RMVA=$P(RDAT,U,1)
27 ....S RMCOM=$P(RDAT,U,2)
28 ....S RMUSE=$P(RDAT,U,3)
29 ....S RMISU=$P(RDAT,U,4)
30 ....S RMISN=$P(RDAT,U,5)
31 ....S RMAVEN=$P(RDAT,U,6)
32 ....S RMDLEN=$P(RDAT,U,7)
33 ....S RMQOHU=$P(RDAT,U,8)
34 ....S RMQOHN=$P(RDAT,U,9)
35 ....S RMVALU=$P(RDAT,U,10)
36 ....S RMVALN=$P(RDAT,U,11)
37 ....S RMAVEU=$P(RDAT,U,12)
38 ....S RMDLEU=$P(RDAT,U,13)
39 ....;total for HCPCS
40 ....S RMTVAH=RMTVAH+RMVA
41 ....S RMTCOMH=RMTCOMH+RMCOM
42 ....S RMTISUH=RMTISUH+RMISU
43 ....S RMTISNH=RMTISNH+RMISN
44 ....I (RMCOM'=""),$G(RMCOM) S RTUSEHC=RTUSEHC+RMCOM
45 ....I (RMVA'=""),$G(RMVA) S RTUSEHA=RTUSEHA+RMVA
46 ....S RMTQOHUH=RMTQOHUH+RMQOHU
47 ....S RMTQOHNH=RMTQOHNH+RMQOHN
48 ....S RMTVALUH=RMTVALUH+RMVALU
49 ....S RMTVALNH=RMTVALNH+RMVALN
50 ....S RMGTOU=RMGTOU+RMVALU
51 ....S RMGTON=RMGTON+RMVALN
52 ....S RMGTIU=RMGTIU+RMISU
53 ....S RMGTIN=RMGTIN+RMISN
54 ....;total for line item
55 ....S RMTVAL=RMTVAL+RMVA
56 ....S RMTCOML=RMTCOML+RMCOM
57 ....;S RMTUSEL=RMTUSEL+RMUSE
58 ....S:RMVA'="" RMTUSELU=RMTUSELU+RMVA
59 ....S:RMCOM'="" RMTUSELN=RMTUSELN+RMCOM
60 ....S RMTISUL=RMTISUL+RMISU
61 ....S RMTAVELU=RMTAVELU+RMAVEU
62 ....S RMTAVELN=RMTAVELN+RMAVEN
63 ....S RMTDLEL=RMTDLEL+RMDLEU+RMDLEN
64 ....S RMTISNL=RMTISNL+RMISN
65 ....S RMTQOHUL=RMTQOHUL+RMQOHU
66 ....S RMTQOHNL=RMTQOHNL+RMQOHN
67 ....S RMTVALUL=RMTVALUL+RMVALU
68 ....S RMTVALNL=RMTVALNL+RMVALN
69 ....S (RPRINT,RPR)=1
70 Q
71 ;
72HDRH ;print heading.
73 Q:$G(RFL)
74 S RMPAGE=RMPAGE+1
75 W !,"PROSTHETIC INVENTORY HCPCS SUMMARY REPORT",?50,"Run Date: ",RMRDATE,?100,"Page: ",RMPAGE
76 W !,"STATION: ",$E(RSTN,1,20)
77 W ?32,RMBD," - ",RMED," [ ",RMCALDAY," calendar days ]"
78 Q
79 ;
80GLN1 ;print NPPD GROUP and LINE header.
81 Q:$G(RFL)
82 W !!,RJ," ",RNPLINE," [ ",RNPGRP," ]"
83 D LBL1^RMPR5HQ2
84 Q
85 ;
86SUMH1 ;
87 Q:$G(RFL)
88 S:$G(RTUSEHC) RTAVEHC=RTUSEHC/RMCALDAY
89 S:$G(RTAVEHC) RTDLEHC=RMTQOHNH/RTAVEHC
90 S:$G(RTUSEHA) RTAVEHA=RTUSEHA/RMCALDAY
91 S:$G(RTAVEHA) RTDLEHA=RMTQOHUH/RTAVEHA
92 S RTDLEHA=$S(RTDLEHA>999:">999",1:$J(RTDLEHA,6,0))
93 S RTDLEHC=$S(RTDLEHC>999:">999",1:$J(RTDLEHC,6,0))
94 S:RMTQOHNH=0 RTDLEHC=""
95 S:RMTQOHUH=0 RTDLEHA=""
96 S:(RMTQOHNH>0)&(RMTCOMH<1) RTDLEHC=">"_RMCALDAY
97 S:(RMTQOHUH>0)&(RMTVAH<1) RTDLEHA=">"_RMCALDAY
98 S RMTAVEL=RTAVEHA+RTAVEHC
99 ;next 2 lines for used:
100 W !,RHCPC,?10,$E(RNPITEM,1,10),"(Used)",?26,$J(RMTVAH,5),?34,$J($FN(RMTISUH,",",2),6),?40,"|",?59,"|",?60,$J(RTUSEHA,5),?67,"|",?71,$J(RTAVEHA,5,2),?78,"|"
101 W ?81,$J(RMTQOHUH,5),?94,"|",?97,$J(RTDLEHA,6),?103,"|",?104,$J($FN(RMTVALUH,",",2),11)
102 ;next 2 lines for new:
103 W !,RHCPC,?10,$E(RNPITEM,1,10),"(New)",?40,"|",?41,$J(RMTCOMH,4),?49,$J($FN(RMTISNH,",",2),9),?59,"|",?60,$J(RTUSEHC,5),?67,"|",?71,$J(RTAVEHC,5,2),?78,"|"
104 W ?87,$J(RMTQOHNH,6),?94,"|",?97,$J(RTDLEHC,6),?103,"|",?116,$J($FN(RMTVALNH,",",2),11)
105 S RPR=1
106 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 HDRH,LBL1^RMPR5HQ2
107 I $Y+8>IOSL,IOST'["C-" W @IOF D HDRH,LBL1^RMPR5HQ2
108 S (RMTVAH,RMTISUH,RMTCOMH,RMTISNH,RMTUSEH,RMTAVEH,RMTQOHUH,RMTQOHNH,RMTVALUH,RMTVALNH,RHCNT)=0
109 S (RTUSEHA,RTUSEHC,RTDLEHA,RTDLEHC,RTAVEHA,RTAVEHC)=0
110 Q
Note: See TracBrowser for help on using the repository browser.