source: FOIAVistA/tag/r/PROSTHETICS-RMPR-RMPO-RMPS/RMPRPI05.m@ 1383

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

initial load of FOIAVistA 6/30/08 version

File size: 3.6 KB
Line 
1RMPRPI05 ;HIN/RVD-PRINT INVENTORY BALANCE BY LOCATION ;3/8/05 11:26
2 ;;3.0;PROSTHETICS;**61**;Feb 09, 1996
3 ; DBIA #10090 - Read Access to entire file #4.
4 ; DBIA #10096 - Access to all %ZOSF nodes.
5 ;
6 D DIV4^RMPRSIT I $D(Y),(Y<0) Q
7 S X="NOW" D ^%DT D DD^%DT S RMDAT=Y
8 ;
9EN K ^TMP($J),RMPRI,RMPRFLG S RMPREND=0 D HOME^%ZIS
10 S DIC="^RMPR(661.5,",DIC(0)="AEQ"
11 S DIC("S")="I $P(^RMPR(661.5,+Y,0),U,2)=RMPR(""STA"")"
12 ;
13EN1 R !!,"Enter 'ALL' for all Locations or 'RETURN' to select individual Locations: ",RMENTER:DTIME G:$D(DTOUT)!$D(DUOUT)!(RMENTER="^") EXIT1
14 G:RMENTER["?" EN1
15 S X=RMENTER X ^%ZOSF("UPPERCASE") S RMENTER=Y
16 I RMENTER="ALL" S RMPRI="*" G CONT
17 W ! F RML=1:1 S DIC("A")="Select Location "_RML_": " D ^DIC G:$D(DTOUT)!(X["^")!(X=""&(RML=1)) EXIT1 Q:X="" D
18 .S RMLOCI=+Y
19 .I $D(RMPRI(RMLOCI)) W $C(7)," ??",?40,"..Duplicate Location" S RML=RML-1 Q
20 .S RMPRI(RMLOCI)=""
21 ;
22CONT G:'$D(RMPRI) EXIT1 S %ZIS="MQ" K IOP D ^%ZIS G:POP EXIT1
23 I '$D(IO("Q")) U IO G PRINT
24 K IO("Q") S ZTDESC="PROSTHETIC INVENTORY LOCATION SUMMARY"
25 S ZTRTN="PRINT^RMPRPI05",ZTIO=ION,ZTSAVE("RMPRI(")="",ZTSAVE("RMPRI")=""
26 S ZTSAVE("RMPR(""STA"")")="",ZTSAVE("RMDAT")="",ZTSAVE("RMPR(")=""
27 D ^%ZTLOAD W:$D(ZTSK) !,"REQUEST QUEUED!" H 1 G EXIT1
28 ;
29PRINT I $E(IOST)["C" W !!,"Processing report....."
30 ;
31 ;call API
32 ;input variables:
33 ; RM = any subscript to be used
34 ; RS = rmpr("sta")
35 ; RMPRI = rmpri(location array)
36 ;
37 S RS=RMPR("STA"),RM="RM"
38 ;S RMCHK=$$LBAL^RMPRPI02(RM,RS,.RMPRI)
39 ;I RMCHK W !!,"***Error in API RMPRPI02 !!!!",!! G EXIT
40 D PROC^RMPRPI02(RM,RS,.RMPRI)
41 ;
42 S RMPAGE=1,RMPREND=0
43 I '$D(^TMP($J,"RM")) D NONE G EXIT
44 W:$E(IOST)["C" @IOF
45 D HEAD,WRI
46 G EXIT
47 ;
48 ;write/print report
49 ;rl = Location
50 ;rh = HCPCS
51 ;j = Item
52 ;k = Date
53 ;
54WRI S RL=""
55 F S RL=$O(^TMP($J,"RM",RL)) Q:(RL="")!(RMPREND) K RMPRFLG S RH="",RLF=RL F S RH=$O(^TMP($J,"RM",RL,RH)) Q:(RH="")!(RMPREND) S J=0 D
56 .F S J=$O(^TMP($J,"RM",RL,RH,J)) Q:(J'>0)!(RMPREND) S K=0 F S K=$O(^TMP($J,"RM",RL,RH,J,K)) Q:(K'>0)!(RMPREND) D
57 ..S RM3=^TMP($J,"RM",RL,RH,J,K)
58 ..S RMIT=J
59 ..S RMDTE=" "
60 ..S:K'=1 RMDTE=$E(K,4,5)_"/"_$E(K,6,7)_"/"_$E(K,2,3)
61 ..S (RMAST,RMUNI)=""
62 ..S RMROR=$P(RM3,U,7)
63 ..S RMQTY=$P(RM3,U,1)
64 ..S RMCOS=$P(RM3,U,3)
65 ..S RMVAL=$P(RM3,U,2)
66 ..S RMVEN=$P(RM3,U,4)
67 ..S RMIDE=$P(RM3,U,5)
68 ..S RMUNI=$P(RM3,U,8)
69 ..S RMSOR=$P(RM3,U,9)
70 ..S:RMROR>RMQTY RMAST="*"
71 ..S:RMQTY="" RMQTY=0
72 ..S RLO=RL
73 ..I '$D(RMPRFLG) D HEAD1
74 ..S RMIDE=$E(RMIDE,1,24)
75 ..W !,RH_"-"_RMIT,?10,RMIDE,?35,RMSOR,?37,$E(RMVEN,1,6),?44,RMDTE,?54,RMUNI,?56,$J(RMQTY,4)
76 ..W ?61,$J(RMCOS,8,2),?69,$J($FN(RMVAL,",",2),10)
77 ..S RMPRFLG=1
78 ..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
79 ..I $Y>(IOSL-6) W @IOF D HEAD,HEAD1 Q
80 W !,RMPR("L"),!,"<End of Report>"
81 Q
82 ;
83HEAD W !,"*** PROSTHETICS INVENTORY BALANCE BY LOCATION ***"
84 W ?68,"PAGE: ",RMPAGE
85 W !,"Run Date: ",RMDAT,?30,"station: ",$E($P($G(^DIC(4,RS,0)),U,1),1,20)
86 S RMPAGE=RMPAGE+1
87 Q
88 ;
89HEAD1 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
90 I $E(IOST)'["C",($Y>(IOSL-6)) W @IOF D HEAD
91 W !,RMPR("L")
92 W !,"Location: ",RLO
93 W !,?52,"UNIT"
94 W !,?45,"DATE",?53,"OF",?65,"UNIT",?74,"TOTAL"
95 W !,"HCPCS",?10,"ITEM",?33,"SRC",?37,"VENDOR"
96 W ?45,"RECVD",?52,"ISSUE",?58,"QTY",?65,"COST",?74,"VALUE"
97 W !,"-----",?10,"----",?33,"---",?37,"------"
98 W ?45,"-----",?52,"-----",?58,"---",?65,"----",?73,"------"
99 S RMPRFLG=1
100 Q
101 ;
102EXIT I $E(IOST)["C",'RMPREND W ! S DIR(0)="E" D ^DIR
103 ;
104EXIT1 D ^%ZISC
105 N RMPR,RMPRSITE D KILL^XUSCLEAN
106 K ^TMP($J)
107 Q
108 ;
109NONE ;
110 W:$E(IOST)["C" @IOF
111 D HEAD
112 W !!,"NO DATA !!!!"
113 Q
Note: See TracBrowser for help on using the repository browser.