source: FOIAVistA/trunk/r/PROSTHETICS-RMPR-RMPO-RMPS/RMPRPI15.m@ 1397

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

initial load of FOIAVistA 6/30/08 version

File size: 3.4 KB
Line 
1RMPRPI15 ;HINES OIFO/RVD-PRINT STOCK RECONCILIATION WORK SHEET ;3/8/05 11:43
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 STOCK RECONCILIATION REPORT"
25 S ZTRTN="PRINT^RMPRPI15",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 D PROC^RMPRPI02(RM,RS,.RMPRI)
39 ;
40 S RMPAGE=1,RMPREND=0
41 I '$D(^TMP($J,"RM")) D NONE G EXIT
42 W:$E(IOST)["C" @IOF
43 D HEAD,WRI
44 G EXIT
45 ;
46 ;write/print report
47 ;rl = Location
48 ;rh = HCPCS
49 ;j = Item
50 ;k = Date
51 ;
52WRI S RL=""
53 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
54 .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
55 ..Q:K=1
56 ..S RM3=^TMP($J,"RM",RL,RH,J,K)
57 ..S RMIT=J
58 ..S RMDTE=" "
59 ..S RMDTE=$E(K,4,5)_"/"_$E(K,6,7)_"/"_$E(K,2,3)
60 ..S RMROR=$P(RM3,U,7)
61 ..S RMQTY=$P(RM3,U,1)
62 ..S RMCOS=$P(RM3,U,3)
63 ..S RMVAL=$P(RM3,U,2)
64 ..S RMVEN=$P(RM3,U,4)
65 ..S RMIDE=$P(RM3,U,5)
66 ..S RMSOR=$P(RM3,U,9)
67 ..S RLO=RL
68 ..I '$D(RMPRFLG) D HEAD1
69 ..S RMIDE=$E(RMIDE,1,60)
70 ..W !,RH_"-"_RMIT,?12,RMIDE
71 ..W !,?27,RMDTE,?36,$J(RMCOS,8,2),?46,$E(RMVEN,1,9),?56,$J(RMQTY,4),?62,$E(RLO,1,9),?72,"________"
72 ..S RMPRFLG=1
73 ..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
74 ..I $Y>(IOSL-6) W @IOF D HEAD,HEAD1 Q
75 W !,RMPR("L"),!,"<End of Report>"
76 Q
77 ;
78HEAD W !,"*** PROSTHETICS STOCK RECONCILIATION WORK SHEET ***"
79 W ?68,"PAGE: ",RMPAGE
80 W !,"Run Date: ",RMDAT,?30,"station: ",$E($P($G(^DIC(4,RS,0)),U,1),1,20)
81 S RMPAGE=RMPAGE+1
82 Q
83 ;
84HEAD1 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
85 I $E(IOST)'["C",($Y>(IOSL-6)) W @IOF D HEAD
86 W !,RMPR("L")
87 W !,"Location: ",RLO
88 W !,?40,"UNIT",?72,"PHYSICAL"
89 W !,"HCPCS",?12,"ITEM",?27,"DATE",?40,"COST",?46,"VENDOR"
90 W ?57,"QTY",?62,"LOCATION",?75,"COUNT"
91 W !,"-----",?12,"----",?27,"----",?40,"----",?46,"------"
92 W ?57,"---",?62,"--------",?75,"-----"
93 S RMPRFLG=1
94 Q
95 ;
96EXIT I $E(IOST)["C",'RMPREND W ! S DIR(0)="E" D ^DIR
97 ;
98EXIT1 D ^%ZISC
99 N RMPR,RMPRSITE D KILL^XUSCLEAN
100 K ^TMP($J)
101 Q
102 ;
103NONE ;
104 W:$E(IOST)["C" @IOF
105 D HEAD
106 W !!,"NO DATA !!!!"
107 Q
Note: See TracBrowser for help on using the repository browser.