source: FOIAVistA/trunk/r/PROSTHETICS-RMPR-RMPO-RMPS/RMPRSTI.m@ 1724

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

initial load of FOIAVistA 6/30/08 version

File size: 7.4 KB
Line 
1RMPRSTI ;HINCIO/RVD-ISSUE FROM STOCK ;11/6/00
2 ;;3.0;PROSTHETICS;**53,62**;Feb 09, 1996
3 ;
4 ;RVD patch #62 - modified for PCE interface
5 ;
6 S (RMPRG,RMPRF,RMENTSUS)="" D HOME^%ZIS W @IOF
7 I '$D(RMPR) D DIV4^RMPRSIT G:$D(X) EXIT^RMPRSTE
8 I $D(RMPRDFN),$D(^TMP($J,"RMPRPCE")) D LINK^RMPRS
9 K ^TMP($J,"RMPRPCE")
10 W ! D GETPAT^RMPRUTIL G:'$D(RMPRDFN) EXIT^RMPRSTE
11VIEW ;
12 N RMPRBAC1,RMDES
13 S RMPRBAC1=1 D ^RMPRPAT K RMPRBAC1
14 I $D(RMPRKILL)!($D(DTOUT)) W $C(7),!,"Deleted..." G EXIT^RMPRSTE
15 S CK="W:$D(DUOUT) @IOF,!!!?28,$C(7),""Deleted..."" G EXIT^RMPRSTE"
16 S CK2="W @IOF,!!!?28,$C(7),""Deleted..."" H 2"
17 S CK1="W $C(7),!,""Timed-Out, Deleted..."" G EXIT^RMPRSTE"
18 S R3("D")=""
19 ;
20RES ;ENTRY POINT TO ADD ADDITIONAL ITEMS FOR ISSUE FROM STOCK
21 Q:$G(RMPRDFN)<1
22 K DA,DD,DIC,PRC,X,Y,RMSO,RMQTY,RMDAHC,RMLACO,RMITDA,RMHCOLD
23 S (R1(1),R1(0),R3("D"),R4("D"),R1("AM"),RMPRI("AMS"),R1("D"),RMLOC)=""
24 S RMLODES=""
25 S (RMLOCOLD,RMIT,RMHCNEW,RMHCOLD,RMITDESC,RMITIEN,R1(2))="",REDIT=0
26 S R1(0)=DT_U_RMPRDFN_U_DT,$P(R1(0),U,10)=RMPR("STA"),$P(R1(0),U,27)=DUZ
27 ;
281 ;ENTRY POINT TO EDIT ITEM ON ISSUE FROM STOCK
29 S (RMHCNEW,RMHCOLD)=$P(R1(1),U,4),RMLOCOLD=RMLOC,RMITOLD=RMIT
30 K RQUIT S RMHCFLG=0
31 W @IOF,!?30,RMPRNAM,!
32 W:$G(REDIT) !!,"Editing a Stock Item!!!"
33 W:'$G(REDIT) !!,"Entering a Stock Item!!!"
34 ;
35TRAN ;TYPE OF TRANSACTION
36 W !
37 ;S DIR(0)="660,2"
38 K DIR
39 S:$P(R1(0),U,4)?.E&($P(R3("D"),U,4)'="") DIR("B")=$P(R3("D"),U,4)
40 S DIR(0)="SO^I:INITIAL ISSUE;X:REPAIR;R:REPLACE;S:SPARE"
41 S DIR("A")="TYPE OF TRANSACTION"
42 D ^DIR
43 I (Y=""),($P(R3("D"),U,4)="") G ^RMPRSTI
44 I $P(R3("D"),U,4)'=""&($D(DUOUT)) G LIST^RMPRSTE
45 I $D(DTOUT) X CK1 Q
46 I $D(DUOUT) G ^RMPRSTI
47 S $P(R1(0),U,4)=Y K DIR
48 S $P(R3("D"),U,4)=$S(Y="I":"INITIAL ISSUE",Y="X":"REPAIR",Y="R":"REPLACE",Y="S":"SPARE",1:"")
49 ;
50PCAT ;
51 S DIR(0)="660,62" S:$P(R1("AM"),U,3)?1N.N DIR("B")=$P(R4("D"),U,3)
52 D ^DIR I $P(R1("AM"),U,3)'=""&($D(DUOUT)) G LIST^RMPRSTE
53 I $D(DTOUT) X CK1 Q
54 I $D(DUOUT) X CK2 G ^RMPRSTI
55 S $P(R1("AM"),U,3)=Y,$P(R4("D"),U,3)=$S(Y=1:"SC/OP",Y=2:"SC/IP",Y=3:"NSC/IP",Y=4:"NSC/OP",1:"") K DIR
56 I Y<4 S $P(R1("AM"),U,4)="",$P(R4("D"),U,4)="" G 2
57 ;
58SPE I Y=4 S DIR(0)="660,63" S:$P(R1("AM"),U,4)?1N.N DIR("B")=$P(R4("D"),U,4) D ^DIR I $D(DTOUT) X CK1 Q
59 I $G(REDIT)&($D(DUOUT)) G LIST^RMPRSTE
60 I $D(DUOUT) X CK2 G ^RMPRSTI
61 I $P(R1("AM"),U,3)=4 S $P(R1("AM"),U,4)=Y,$P(R4("D"),U,4)=$S(Y=1:"SPECIAL LEGISLATION",Y=2:"A&A",Y=3:"PHC",Y=4:"ELIGIBILITY REFORM",1:"")
62 ;
632 S DIC(0)="AEQM",DIC=661 S:$P(R1(0),U,6) DIC("B")=$P(^RMPR(661,$P(R1(0),U,6),0),U) S DIC("A")="ITEM: "
64 K DIC("S") D ^DIC
65 I $P(R3("D"),U,6)&$D(DUOUT) G LIST^RMPRSTE
66 I $D(DUOUT) X CK2 G ^RMPRSTI
67 I $D(DTOUT) X CK1 Q
68 I +Y'>0 W !!,?5,$C(7),"This is a required response. Enter '^' to exit",! G 2
69 S $P(R1(0),U,6)=+Y,$P(R3("D"),U,6)=$P(Y,U,2)
70 ;
71LOC ;ask for location
72 S (RMITFLG,RMHCFLG,RMHCDA,RMITDA,RMAV,RMAVA,RMCO,RMBAL)=0
73 K DIC,Y,X,RQUIT,DTOUT,DUOUT
74 S DZ="??",D="B",DIC("S")="I $P(^RMPR(661.3,+Y,0),U,3)=RMPR(""STA"")"
75 S:RMLOCOLD'="" DIC("B")=RMLOCOLD
76 S DIC="^RMPR(661.3,",DIC(0)="AEQM"
77 S DIC("A")="Enter Pros Location: " D MIX^DIC1
78 I $G(REDIT)&$D(DUOUT) G LIST^RMPRSTE
79 I $D(DUOUT) X CK2 G ^RMPRSTI
80 I $D(DTOUT) X CK1 Q
81 I X="" W !,"This is a mandatory field!!!",! G LOC
82 S RMLOC=+Y
83 G:'$D(^RMPR(661.3,RMLOC,0)) LOC
84 ;
85HCPCS ;HCPCS code
86 K DIC,RMR,RMX,RQUIT S DIC("A")="PSAS HCPCS: ",DA(1)=RMLOC,RMF=1
87 I $P(R1(1),U,4)&(RMLOCOLD=RMLOC) S DIC("B")=$P(R1(1),U,4)
88 S DIC="^RMPR(661.3,"_DA(1)_",1,",DIC(0)="AEMNZ"
89 S DIC("W")="S RZ=$P(^RMPR(661.3,RMLOC,1,+Y,0),U,1) I RZ W ?30,$P(^RMPR(661.1,RZ,0),U,2)"
90 D ^DIC
91 I $D(DUOUT) G LOC
92 I $D(DTOUT) X CK1 Q
93 I X="" W !,"This is a mandatory field!!!",! G HCPCS
94 S (RMHCNEW,RMDAHC)=$P($G(^RMPR(661.3,RMLOC,1,+Y,0)),U,1)
95 I $G(RMDAHC),$P(^RMPR(661.1,RMDAHC,0),U,5)'=1 D INACT G HCPCS
96 S RMHCPC=$P(^RMPR(661.1,RMDAHC,0),U,1),RMHCDA=+Y
97 S RDESC=$P(^RMPR(661.1,RMDAHC,0),U,2)
98 ;
99CPT ;ask for CPT Modifier
100 K DIC,Y,RQUIT
101 S RDA=RMDAHC_"^"_$P(R1(0),U,4)_"^"_$P(R1(0),U,14)_"^"_660
102 D:$D(RMCPT) CHK^RMPRED5
103 W:$G(REDIT) !,"OLD CPT MODIFIER: ",$P(R1(1),U,6)
104 I RMHCOLD'=RMDAHC D CPT^RMPRCPTU(RDA) G:$D(DUOUT)!$D(DTOUT) LIST^RMPRSTE S $P(R1(1),U,6)=$G(RMCPT) W:$G(REDIT) !,"NEW CPT MODIFIER: ",$G(RMCPT)
105 I RMHCOLD'="",(RMHCOLD=RMDAHC),$G(REDIT) D
106 .S DIR(0)="Y",DIR("A")="Would you like to Edit CPT MODIFIER Entry ",DIR("B")="N" D ^DIR Q:$D(DTOUT)!$D(DUOUT)
107 .I $G(Y) D CPT^RMPRCPTU(RDA) Q:$D(DUOUT)!$D(DUOUT) S $P(R1(1),U,6)=$G(RMCPT) W !,"NEW CPT MODIFIER: ",$G(RMCPT)
108 K DIR
109 ;
110 ;D ITEM^RMPR5NU1(REDIT,RMLOC,RMLOCOLD,RMDAHC,RMHCOLD,RMHCDA,RMIT)
111 ;
112ITEM ;ask for PSAS Item to edit.
113 S DA(2)=RMLOC,DA(1)=RMHCDA K DIC,RMU3,RMUBA,RQUIT
114 S DIC("A")="Enter PSAS Item: ",DIC(0)="AEMNQ"
115 I RMDAHC=RMHCOLD S DIC("B")=$G(RMIT)
116 S DIC="^RMPR(661.3,"_DA(2)_",1,"_DA(1)_",1,"
117 D ^DIC
118 I $D(DUOUT) G LOC
119 I $D(DTOUT) X CK1 Q
120 I X="" W !,"This is a mandatory field!!!",! G ITEM
121 S RMITDA=+Y
122 S RMU3=$G(^RMPR(661.3,RMLOC,1,RMHCDA,1,RMITDA,0))
123 S RMUBA=$P(RMU3,U,2)
124 S (RMITDES,RMIT)=$P(RMU3,U,1)
125 S RMDES=RMIT K DIC("B"),DIC("S")
126 I RMUBA<1 D LOWBA G LOC
127 ;
128 I $D(RMLOC),$D(RMHCDA),$D(RMITDA) S RMSO=$$SOURCE^RMPR5NU1
129 I $D(RMSO),RMSO="" D MESSO G LOC
130 S:$D(RMSO) $P(R1(0),U,14)=RMSO
131 S $P(R3("D"),U,14)=$S(RMSO="C":"COMMERCIAL",RMSO="V":"VA",1:"")
132 I $P(R1(1),U,4)'="",$D(DUOUT) G LIST^RMPRSTE
133 I $G(RMLOC),'($G(RMHCDA)&$G(RMITDA)) W !,"PSAS Item was not selected!!" G LOC
134 I $G(RMLOC),$G(RMHCDA),$G(RMITDA) S RMPRUCST=$$COST^RMPR5NU1
135 I '$G(RMPRUCST) D MESSI G LOC
136 S:$G(REDIT) $P(R1(0),U,16)=RMPRUCST*$P(R1(0),U,7),$P(R3("D"),U,16)=RMPRUCST*$P(R1(0),U,7)
137 K DIC
138 ;
139VEN ;vendor
140 S $P(R1(1),U,4)=RMDAHC,$P(R1(0),U,22)=$P(^RMPR(661.1,RMDAHC,0),U,4)
141 S RMITNEW=RMIT D NODE2
142 I $D(RMLOC),$D(RMHCDA),$D(RMITDA) S DIC("B")=$$VEND^RMPR5NU1
143 S $P(R1(0),U,9)=DIC("B")
144 S DIC(0)="AEQM",DIC=440,DIC("A")="VENDOR: "
145 D ^DIC I $P(R3("D"),U,9)'=""&$D(DUOUT) G LIST^RMPRSTE
146 I $D(DTOUT) X CK1 Q
147 I $D(DUOUT) G LOC
148 I +Y'>0 W !!,?5,$C(7),"This is a required response. Enter '^' to exit",! G VEN
149 S $P(R1(0),U,9)=+Y,$P(R3("D"),U,9)=$P(Y,U,2) K DIC,Y,X
150 G ^RMPRSTE
151 ;
152NODE2 ;set node2 of file #660
153 N RMDAHC,RMITDESC
154 S RMDAHC=$P(R1(1),U,4)
155 Q:'$G(RMDAHC)
156 S:$D(RMIT) RMITIEN=$P(RMIT,"-",2)
157 I $G(RMITIEN),$G(RMDAHC) S:$D(^RMPR(661.1,RMDAHC,3,RMITIEN,0)) RMITDESC=$P(^(0),U,1)
158 S:$D(RMIT) $P(R1(2),U,1)=RMIT S:$D(RMITDESC) $P(R1(2),U,2)=RMITDESC
159 Q
160 ;
161MESSI ;print message if COST is not defined in the inventory (661.3)
162 S:'$D(RMIT) RMIT=""
163 W !!,"***ITEM COST is not defined @:"
164 W !," PSAS Item = ",RMIT
165 W !," Location = ",$P($G(^RMPR(661.3,RMLOC,0)),U,1)
166 W !,"***Fix your inventory or use a different PSAS ITEM!!",!!
167 Q
168 ;
169MESSO ;print message if SOURCE is not defined in the inventory (661.3)
170 W !!,"***PSAS ITEM has no SOURCE at this location..."
171 W !,"***Fix your inventory or use a different PSAS ITEM!!",!!
172 Q
173 ;
174INACT ;print message if HCPCS is inactive.
175 W !!,"*** You have selected an INACTIVE HCPCS..."
176 W !,"*** Please REMOVE this HCPCS from inventory..."
177 W !,"*** And use a different HCPCS!!!",!
178 Q
179 ;
180LOWBA ;print message if inventory balance is low.
181 S:'$D(RMUBA) RMUBA="" S:'$D(RMIT) RMIT=""
182 W !!,"*** PSAS Item ",RMIT," balance is = ",RMUBA
183 W !,"*** You are unable to use this PSAS ITEM..."
184 W !,"*** Please use a different Location, HCPCS or PSAS Item !!!!",!
185 Q
186 ;
187LKP ;print a message if PSAS HCPCS not in PIP or invalid HCPCS.
188 Q:'$G(RMF)!(X=" ")
189 S X=$TR(X,"abcdefghijklmnopqrstuvwxyz","ABCDEFGHIJKLMNOPQRSTUVWXYZ")
190 K RX
191 I $D(^RMPR(661.3,"D1",X,RMLOC)) S RX=1
192 I '$G(RX),$D(^RMPR(661.1,"B",X)) D EN^DDIOL("*** Only PSAS HCPCS in PIP can be issued. Please verify your Location and PSAS HCPCS!!","","!!")
193 K RX
194 Q
Note: See TracBrowser for help on using the repository browser.