source: WorldVistAEHR/trunk/r/PROSTHETICS-RMPR-RMPO-RMPS/RMPR29LI.m@ 642

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

initial load of WorldVistAEHR

File size: 9.1 KB
Line 
1RMPR29LI ;HIN/RVD-ENTER LAB STOCK ISSUE 2529-3 [ 11/05/98
2 ;;3.0;PROSTHETICS;**33,37**;Feb 09,1996
3CREATE ;CREATE Lab Stock Issue 2529-3
4 K RMPREDIT,RMPRTMP,RMPR25,REDIT,RMCLOF,DIC D DIV4^RMPRSIT G:$D(X) EXIT
5 D GETPAT^RMPRUTIL I '$D(RMPRDFN) G EXIT
6 S RMDFN=RMPRDFN
7VIEW ;CREATE Lab Stock Issue 2529-3 VIA LAB MENU
8 N RMPRDA,RMPRWO,RMPRJOB S RMPRF=15,RFLG=1,RNEW=1 D ^RMPRPAT
9 S DIC="^RMPR(664.1,",DIC(0)="ZL",X=DT
10 S DLAYGO=664.1 D FILE^DICN K DLAYGO,DIC G:+Y'>0 EXIT
11 S RMPRDA=+Y,$P(^RMPR(664.1,RMPRDA,0),U,2)=RMDFN,$P(^(0),U,3)=RMPR("STA"),$P(^(0),U,17)="S"
12 S IDEF=$$STA^RMPR31U(RMPR("STA"))
13 S DA=RMPRDA,DIK="^RMPR(664.1," D IX1^DIK
14 K DR,DA,DIC,DIK,Y,DIE D KVAR^VADPT
15 S RMPRDFN=$P(^RMPR(664.1,RMPRDA,0),U,2),VAIP("D")="L"
16 D IN5^VADPT S VAINDT=$P($G(VAIP(3)),U) D INP^VADPT
17 I $G(RMPRDA)>0,$G(RMPRDA)'="" D TYPE
18 G EXIT
19EDT ;EDIT/DELETE 2529-3
20 D DIV4^RMPRSIT G:$D(X) EXIT
21 K ^TMP($J),DR,DIC,RMPRDA S REDIT=1
22 S DIC="^RMPR(664.1,",DIC(0)="AEQM",DR=".01"
23 S DIC("S")="I $P(^(0),U,17)=""S""",DIC("W")="D EN3^RMPRD1"
24 D ^DIC K DIC G:+Y'>0 EXIT S RMPRDA=+Y I $G(RMPRDA)'>0 Q
25 L +^RMPR(664.1,RMPRDA,0):1
26 I '$T W $C(7),!!,?5,"Someone is already editing this entry" G EXIT
27 S RMPRDFN=$P(^RMPR(664.1,RMPRDA,0),U,2)
28 D IN5^VADPT S VAINDT=$P($G(VAIP(3)),U) D INP^VADPT
29 D LIS^RMPR29LU K DIR
30 S DIR(0)="Y",DIR("A")="Would you like to Edit this Entry",DIR("B")="YES"
31 D ^DIR G:$D(DTOUT)!($D(DUOUT)) EXIT G:Y=0!(Y<0) EXIT
32 S RL=$O(^RMPR(664.1,RMPRDA,2,0)) I RL D
33 .S RM2=$G(^RMPR(664.1,RMPRDA,2,RL,0)),RMTYPS=$P(RM2,U,7)
34 .S RMCATS=$P(RM2,U,8),RMSPES=$P(RM2,U,9),RMGIP=$P(RM2,U,13)
35 .S RM23=$G(^RMPR(664.1,RMPRDA,2,RL,3))
36 .S RMHS=$P($G(^RMPR(664.1,RMPRDA,2,RL,2)),U,1)
37 .S RMSO=$P(RM23,U,1),RMLOC=$P(RM23,U,1),RMIT=$P(RM23,U,3)
38TYPE ;
39 S %X="^RMPR(664.1,RMPRDA,",%Y="^TMP($J,RMPRDA," D %XY^%RCR
40 K DIR S PDA=RMPRDA D ST^RMPR29LS S:$G(RMCLOF) REDIT=1
41 I '$G(RMPRDFN) W !,"*** Unable to access patient information, please contact your IRM..",! G EXIT
42 D GD^RMPR29LS I $D(RNEW),$D(RMFLG) D RDL^RMPR29LU G:$D(RMFLG) EXIT
43 I $G(REDIT) S RIDA=$O(^RMPR(664.1,RMPRDA,2,0)) I RIDA D
44 .S RM0=$G(^RMPR(664.1,RMPRDA,2,RIDA,0)),RMTYPS=$P(RM0,U,7),RMCATS=$P(RM0,U,8),RMSPES=$P(RM0,U,9),RMSO=$P($G(^RMPR(664.1,RMPRDA,2,RIDA,3)),U,1)
45 .S RMPRWO=$P(RM0,U,6),RMQTYS=$P(RM0,U,2),RMHS=$P($G(^RMPR(664.1,RMPRDA,2,RIDA,2)),U,1)
46VC S:'$D(RMSO) RMSO="C" S DIR(0)="SBO^V:VA;C:COMMERCIAL",DIR("A")="Select VA or COMMERCIAL SOURCE" S:$D(RMSO) DIR("B")=RMSO
47 S DIR("?")="Enter V for VA or C for Commercial" D ^DIR
48 I $D(DUOUT)!$D(DTOUT) G:$G(REDIT) LAB D RDL^RMPR29LU G EXIT
49 G:Y="" VC S (RMSOR,RMSO)=Y
50TRAN K DIR S DIR(0)="664.16,8"
51 ;S DIR("A")="Enter Type of Transaction: "
52 S:$D(RMTYPS) DIR("B")=$S(RMTYPS="I":"INITIAL",RMTYPS="X":"REPAIR",RMTYPS="R":"REPLACE",RMTYPS="S":"SPARE",1:"")
53 D ^DIR
54 I $D(DUOUT)!$D(DTOUT) G:$G(RMCLOF)!($G(REDIT)) LAB D RDL^RMPR29LU G EXIT
55 I Y="" W !,"Please enter type of Transaction!!" G TRAN
56 S RMTYP=Y
57 S RMTYPS=$S(Y="I":"INITIAL",Y="X":"REPAIR",Y="R":"REPLACE",Y="S":"SPARE",1:"")
58PCAT K DIR S DIR(0)="664.16,9"
59 S:$D(RMCATS) DIR("B")=$S(RMCATS=1:"SC/OP",RMCATS=2:"SC/IP",RMCATS=3:"NSC/IP",RMCATS=4:"NSC/OP",1:"")
60 D ^DIR
61 I $D(DUOUT)!$D(DTOUT) G:$G(RMCLOF)!($G(REDIT)) LAB D RDL^RMPR29LU G EXIT
62 I Y="" W !,"Please enter Patient Category!!" G PCAT
63 S RMCAT=Y,RMCATS=$S(Y=1:"SC/OP",Y=2:"SC/IP",Y=3:"NSC/IP",Y=4:"NSC/OP",1:"") K DIR G:RMCAT<4 ITEM
64 S DIR(0)="664.16,10"
65 S:$D(RMSPES) DIR("B")=$S(RMSPES=1:"SPECIAL LEGISLATION",RMSPES=2:"A&A",RMSPES=3:"PHC",RMSPES=4:"ELIGIBILITY REFORM",1:"")
66 I RMCAT=4 D ^DIR I $D(DUOUT)!$D(DTOUT) G:$G(RMCLOF)!($G(REDIT)) LAB D RDL^RMPR29LU G EXIT
67 I RMCAT=4 S RMSPE=Y,RMSPES=$S(Y=1:"SPECIAL LEGISLATION",Y=2:"A&A",Y=3:"PHC",Y=4:"ELIGIBILITY REFORM",1:"")
68 K DIR
69ITEM ;EDIT 2529-3 ITEM
70 K DIC,DIR,RDEL,RMEDIT,DTOUT,DUOUT,RMITFLG,RMPRGIP S DA=RMPRDA,DIC="^RMPR(664.1,"_RMPRDA_",2,"
71 S DIC("P")="664.16PA",DA(1)=RMPRDA,DIC(0)="AEQML"
72 D ^DIC K DIC G:+Y'>0 LAB
73 S RMITEMS=$P($G(^RMPR(661,$P(Y,U,2),0)),U,1)
74 S (RMIDA,DA)=+Y,DIE="^RMPR(664.1,"_RMPRDA_",2,",DR=".01" D ^DIE I $D(Y)!'$D(^RMPR(664.1,RMPRDA,2,RMIDA,0)) D G ITEM
75 .K ^RMPR(664.1,RMPRDA,2,RMIDA) K DIE,DR,RMIDA S RICHECK=$O(^RMPR(664.1,RMPRDA,2,0))
76 .K:'$G(RICHECK) REDIT
77 I $D(^RMPR(664.1,RMPRDA,2,RMIDA,0)),$P(^RMPR(664.1,RMPRDA,2,RMIDA,0),U,1)="" K ^RMPR(664.1,RMPRDA,2,RMIDA) G ITEM
78 S RM0=$G(^RMPR(664.1,RMPRDA,2,RMIDA,0)),RM3=$G(^RMPR(664.1,RMPRDA,2,RMIDA,3))
79 I $G(REDIT) D
80 .S RMHS=$P($G(^RMPR(664.1,RMPRDA,2,DA,2)),U,1),RMLOC=$P(RM3,U,4),RMIT=$P(RM3,U,3)
81 .S RMQTYS=$P(RM0,U,2),RMUNCO=$P(RM0,U,4),RMITEMS=$P(^RMPR(661,$P(RM0,U,1),0),U,1)
82 .S:'$D(RMCAT) RMCATS=$P(RM0,U,8) S:'$D(RMTYPS) RMTYPS=$P(RM0,U,7) S:'$D(RMSPE) RMSPES=$P(RM0,U,9)
83HCPCS ;HCPCS code
84 K DIC
85 S DIC(0)="AEQM",DIC="^RMPR(661.1,",DIC("A")="PSAS HCPCS: " S:$D(RMHS) DIC("B")=RMHS
86 S DIC("S")="I $P(^RMPR(661.1,+Y,0),U,10)"
87 D ^DIC I $D(DUOUT)!$D(DTOUT) G:$G(RMCLOF)!($G(REDIT)) LAB D RDL^RMPR29LU G EXIT
88 I Y=-1 W !,"HCPCS CODE IS MANDATORY!" D HELP G HCPCS
89 I $P(^RMPR(661.1,+Y,0),U,10)<1 D HELP G HCPCS
90 I +Y>0 G:$P(^RMPR(661.1,+Y,0),U,5)'=1 HCPCS
91 S (RMI,RMHCPC,RMHS,DA(1),RMHCPCS)=+Y D ITEMLOC^RMPR5NU1 K DIC
92 I $G(RMITFLG) G:$G(RMCLOF)!($G(REDIT)) LAB D RDL^RMPR29LU G EXIT
93 K:'$G(RMHCDA)!'$G(RMITDA) RMLOC I $G(RMLOC) S RMGIP=0 G VEN
94GI I $P(^RMPR(669.9,RMPRSITE,0),U,3),'$D(^PRCP(445,"AD",DUZ)) W $C(7),!,"You are not an authorized user of any Inventory Point, please see your ADPAC." H 2 S RMEXIT=1 Q
95 S RMPRGIP=$P(^RMPR(669.9,RMPRSITE,0),U,3),RMFORM=15 I RMPRGIP S PRCPPRIV=1 D INV^RMPR29LS G:$D(RMEXIT)&($G(REDIT)) LAB Q:$D(RMEXIT)
96 G:$D(RDEL) ITEM
97 ;
98VEN K DIC("S")
99 ;S X=" ",DIC=440,DIC(0)="ZM" D ^DIC S:+Y>0 DIC("B")=$P(^PRC(440,+Y,0),U,1)
100VEN0 I $G(RMLOC),$D(RMVEN) S DIC("B")=RMVEN
101 S DIC(0)="AEQM",DIC=440,DIC("A")="VENDOR: " S:$G(REDIT)&($D(RMVENS)) DIC("B")=RMVENS D ^DIC
102 I $D(DTOUT)!$D(DUOUT) G:$G(RMCLOF)!($G(REDIT)) LAB D RDL^RMPR29LU G EXIT
103 I +Y'>0 W !!,?5,$C(7),"This is a required response. Enter '^' to exit",! G VEN
104 S (RMVEN,RMVENS)=+Y K DIC,Y,X
105UNICO ;UNIT COST
106 I (RMSO["C")&($G(RMPRGIP)) S RMCOS=$P($G(^PRCP(445,PRCP("I"),1,PRCP("ITEM"),0)),U,15)
107 I $G(RMLOC) S RMCOS=$P(^RMPR(661.3,RMLOC,1,RMHCDA,1,RMITDA,0),U,10)
108 I $P(RM0,U,4) S RMCOS=$P(RM0,U,4)
109 S DIR(0)="667.3,3",DIR("A")="UNIT COST"
110 S:$D(RMCOS)&($G(RMCOS)>0) DIR("B")=RMCOS
111 D ^DIR K DIR I $D(DUOUT)!$D(DTOUT) G:$G(REDIT)!($G(RMCLOF)) LAB D RDL^RMPR29LU G EXIT
112 I (RMSO["C")&(X<.001) W !,"You must enter a UNIT COST....",! G UNICO
113 S (RMCOS,RMCO)=Y
114 ;
115QTY S DIR(0)="664.16,2" S:$D(RMQTYS) DIR("B")=RMQTYS D ^DIR
116 I $D(DUOUT)!$D(DTOUT) G:$G(REDIT)!($G(RMCLOF)) LAB D RDL^RMPR29LU G EXIT
117 I X<1 W !,"You must enter a quantity....",! G QTY
118 S (RMQTY,RMQTYS)=Y K DIR
119 K DIR S DIR(0)="664.16,12",RMSERS=$P(RM0,U,12) S:$D(RMSERS) DIR("B")=RMSERS D ^DIR
120 I $D(DUOUT)!$D(DTOUT) G:$G(RMCLOF)!($G(REDIT)) LAB D RDL^RMPR29LU G EXIT
121 S (RMSER,RMSERS)=Y,RMSO=RMSOR K DIR
122 S DIE(0)="AEQM",DR=4,DR(1,664.129)="4;",DR(2,664.1294)=".01"
123 S ^RMPR(664.1,RMPRDA,8,0)="^664.129DA",^RMPR(664.1,RMPRDA,8,1,1,0)="^664.1294^"
124 S DA(1)=RMPRDA,DIE="^RMPR(664.1,"_RMPRDA_",8,",DA=1 D ^DIE K DIE,DR,DA
125 S DA(1)=RMPRDA,DA=RMIDA,DIE="^RMPR(664.1,"_RMPRDA_",2,"
126 S DR="2///^S X=$G(RMQTY);4///^S X=$G(RMCO);12///^S X=$G(RMSER);8///^S X=$G(RMTYP);9///^S X=$G(RMCAT);10///^S X=$G(RMSPE);16///^S X=$G(RMIT);14///^S X=$G(RMSOR)"
127 D ^DIE I $D(DTOUT)!$D(DUOUT) G:$G(REDIT)!$G(RMCLOF) LAB G EXIT
128 S RM0=$G(^RMPR(664.1,RMPRDA,2,DA,0)),RMQTY=$P(RM0,U,2),RMCO=$P(RM0,U,4)
129 I RMQTY S RMTOCO=RMQTY*RMCO,DR="11///^S X=$G(RMTOCO);13///^S X=$G(RMHCPC)" D ^DIE
130 S:$G(RMGIP) $P(^RMPR(664.1,RMPRDA,2,DA,0),U,13)=RMGIP
131 S $P(^RMPR(664.1,RMPRDA,2,DA,3),U,4)=$G(RMLOC)
132 S $P(^RMPR(664.1,RMPRDA,2,DA,3),U,2)=$G(RMVEN)
133 G ITEM
134LAB ;ASK TO POST REQUEST
135 I $G(REDIT),$D(RMIDA) D SET^RMPR29LS
136 ;G:$D(RMEXIT)!('$D(RMPRDA)) EXIT
137 S DIR(0)="Y",DIR("A")="Would you like to review this request"
138 S DIR("B")="YES" D ^DIR I $D(DTOUT)!($D(DUOUT)) D SBACK Q:$G(RMCLOF) G:$G(REDIT) EXIT D RDL^RMPR29LU G EXIT
139 I Y=1 S IOP="HOME" D PRT^RMPR29R
140 ;check for required fields
141 D CHK^RMPR29LU K RNEW G:$G(RMEDIT) TYPE D:$G(RMEXIT) RDL^RMPR29LU G:$G(RMEXIT) EXIT
142 K DIR S DIR(0)="Y",DIR("A")="Would you like to post this request"
143 S DIR("B")="YES" D ^DIR I $D(DTOUT)!($D(DUOUT)) D SBACK Q:$G(RMCLOF) G:$G(REDIT) EDT D RDL^RMPR29LU G EXIT
144 I +Y=0 W !,"Request not posted!!" D SBACK Q:$D(RMCLOF) D:$D(RNEW) RDL^RMPR29LU K RMPRDA G:$G(REDIT) EDT G EXIT
145 S RMPRWO=$P(^RMPR(664.1,RMPRDA,0),U,13) G:RMPRWO'="" PRINT S SCR=$P(^(0),U,11)
146 D CR^RMPR29U(SCR) I '$D(RMPRWO) W !,"Request not posted!!" D SBACK Q:$D(RMCLOF) K RMPRDA G:$G(REDIT) EDT G EXIT
147PRINT D SG^RMPR29LS
148 S DIK="^RMPR(664.1,",DA=RMPRDA D IX1^DIK K DIK,DA
149 W !! S DIR(0)="Y",DIR("A")="Would you like to print this 2529-3 request"
150 S DIR("B")="YES" D ^DIR I $D(DTOUT)!($D(DUOUT)) Q:$D(RMCLOF) G EXIT
151 I Y=1 D PRT^RMPR29R
152 Q:$D(RMCLOF)
153 ;suspense record inquiry
154 D LINK^RMPRS
155 I $G(REDIT),'$D(RNEW) K RMPRDA G EDT
156 G CREATE
157 ;end
158 ;
159HELP W !,"** You can only select HCPCS that have a LAB pre-determined time.",!,"** If the HCPCS you are selecting are not in the list, please send an E-mail"
160 W !,"** message to G.PROS-CODE@FORUM.VA.GOV to be added in the list..."
161 Q
162 ;
163SBACK ;set global back to its original data.
164 S %X="^TMP($J,RMPRDA,",%Y="^RMPR(664.1,RMPRDA," D %XY^%RCR
165 W !,"Update not posted...." Q
166 ;
167EXIT ;common exit
168 L:+$G(RMPRDA) -^RMPR(664.1,+RMPRDA,0)
169 N RMPR,RMPRSITE D KILL^XUSCLEAN Q
Note: See TracBrowser for help on using the repository browser.