source: WorldVistAEHR/trunk/r/PROSTHETICS-RMPR-RMPO-RMPS/RMPRED6.m@ 1697

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

initial load of WorldVistAEHR

File size: 7.0 KB
Line 
1RMPRED6 ;PHX/RFM,RVD-EDIT ISSUE FROM STOCK ;9/29/1994
2 ;;3.0;PROSTHETICS;**19,33,35,46,41,53,90**;Feb 09, 1996
3EN ;EDIT STOCK ISSUES
4 D HOME^%ZIS,DIV4^RMPRSIT G:$D(X) EXIT^RMPRED4
5 S DIC("S")="I ($P(^(0),U,13)=11!($P(^(0),U,13)=12)) I $P(^(0),U,10)=RMPR(""STA"")" I RMPRSITE=1 S DIC("S")=DIC("S")_"!($P(^(0),U,10)="""")"
6 S DIC="^RMPR(660,",DIC(0)="AEMQ",DIC("A")="Select PATIENT: ",DIC("W")="D ^RMPRD1" D ^DIC G:Y<0 EXIT^RMPRED4
7 S RMPRIEN=+Y
8 L +^RMPR(660,+Y):1 I $T=0 W !,?5,$C(7),"Someone else is Editing this entry!" G EXIT^RMPRED4
9 S (RMDFN,DFN)=$P(^RMPR(660,+Y,0),U,2)
10 S RMPRF=$P(^RMPR(660,+Y,0),U,13)
11INVSE S %X=DIC_+Y_",",%Y="R1(" D %XY^%RCR
12 S:'$D(R1(2)) R1(2)=""
13 D DEM^VADPT
14 S RMPRNAM=$P(VADM(1),U),RMPRSSN=$P(VADM(2),U)
15 S (RMHCPC,RMHCNEW,RMHCOLD)=$P($G(R1(1)),U,4),REDIT=1,RMPRUCST=0
16 S (RMQNEW,RMQOLD)=$P($G(R1(0)),U,7)
17 S (RMLOCNEW,RMLOCOLD,RMITNEW,RMITOLD)=""
18 S RMSTOCK=$P($G(R1(1)),U,5)
19 I $G(RMSTOCK) S R6612=$G(^RMPR(661.2,RMSTOCK,0)),(RMLOC,RMLOCNEW,RMLOCOLD)=$P(R6612,U,16),(RMIT,RMITNEW,RMITOLD)=$P(R6612,U,9)
20 S R12(0)=R1(0),RMPRREL=$P(R1(0),U,16)
21 I $D(^RMPR(660,RMPRIEN,1)),+$P(^RMPR(660,RMPRIEN,1),U,3) S (RMPRIP,RIPOLD)=$P(^PRCP(445,$P(^RMPR(660,RMPRIEN,1),U,3),0),U)
22 K DIC S R3("D")="",R4("D")=""
23 G SET
24 ;
25CO ;DISPLAYS STOCK ISSUE
26 D CHK^RMPRED5
27 D NODE2^RMPRSTI
28 D ^RMPRST2
29EDX ;POST
30 S DIR(0)="SBO^P:POST;E:EDIT;D:DELETE"
31 S DIR("A")="Woul you like to POST/EDIT/DELETE this entry",DIR("B")="P",DIR("?")="Answer `P` to post the transaction, `E` to edit the transaction,'D' to delete the transaction"
32 D ^DIR K DIR G:Y="P" POST^RMPRED4 G:Y="D" DEL1^RMPRED4
33 G:Y="E" EDT
34 I $D(DIRUT)!$D(DUOUT)!$D(DTOUT) G EXIT^RMPRED4
35DEL ;
36 S DIR(0)="SBO^E:EDIT;D:DELETE",DIR("B")="E"
37 S DIR("A")="Would you like to EDIT/DELETE this Transaction",DIR("?")="Answer 'E' to EDIT the transaction or 'D' to DELETE the transaction." D ^DIR G:$D(DIRUT) EXIT^RMPRED4
38 I Y="E" G EDT
39 I Y="D" G DEL1^RMPRED4
40 ;
41EDT ;edit patient 2319
42 W @IOF,!?30,RMPRNAM,!
43 ;
44EDU S RMTY=$P(R1(0),U,4)
45 K DIR W ! S DIR(0)="660,2",DIR("B")=$S(RMTY="I":"INITIAL ISSUE",RMTY="X":"REPAIR",RMTY="R":"REPLACE",RMTY="S":"SPARE",RMTY=5:"RENTAL",1:"")
46 D ^DIR G:$D(DIRUT) CO S $P(R1(0),U,4)=Y,$P(R3("D"),U,4)=$S(Y="I":"INITIAL ISSUE",Y="X":"REPAIR",Y="R":"REPLACE",Y="S":"SPARE",Y=5:"RENTAL",1:"")
47 S DIR(0)="660,62",DIR("B")=$P(R4("D"),U,3) D ^DIR G:$D(DIRUT) CO 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:"")
48 I Y<4 S $P(R1("AM"),U,4)="",$P(R4("D"),U,4)="" G 2
49 K DIR 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 G:$D(DUOUT)!$D(DTOUT) CO G:$D(DIRUT)!(X="") 2
50 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:"")
51 ;
522 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: "
53 K DIC("S") D ^DIC
54 I $P(R3("D"),U,6)&$D(DUOUT) G CO
55 I $D(DUOUT)!$D(DTOUT) G CO
56 I +Y'>0 W !!,?5,$C(7),"This is a required response. Enter '^' to exit",! G 2
57 S $P(R1(0),U,6)=+Y,$P(R3("D"),U,6)=$P(Y,U,2) K DIC,Y,X
58 ;
59LOC ;ask for location
60 S (RMITFLG,RMHCFLG,RMHCDA,RMITDA,RMAV,RMAVA,RMCO,RMBAL)=0
61 K DIC,Y,X,RQUIT,DTOUT,DUOUT
62 S DZ="??",D="B",DIC("S")="I $P(^RMPR(661.3,+Y,0),U,3)=RMPR(""STA"")"
63 S:RMLOCOLD'="" DIC("B")=RMLOCOLD
64 S DIC="^RMPR(661.3,",DIC(0)="AEQM"
65 S DIC("A")="Enter Pros Location: " D MIX^DIC1
66 I $D(DUOUT)!$D(DTOUT) G CO
67 I X="" W !,"This is a mandatory field!!!",! G LOC
68 S RMLOC=+Y
69 G:'$D(^RMPR(661.3,RMLOC,0)) LOC
70 ;
71HCPCS ;HCPCS code
72 K DIC,RMR,RMX,RQUIT S DIC("A")="PSAS HCPCS: ",DA(1)=RMLOC,RMF=1
73 I $P(R1(1),U,4)&(RMLOCOLD=RMLOC) S DIC("B")=$P(R1(1),U,4)
74 S DIC="^RMPR(661.3,"_DA(1)_",1,",DIC(0)="AEMNZ"
75 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)"
76 D ^DIC I $D(DUOUT)!$D(DTOUT) G LOC
77 I X="" W !,"This is a mandatory field!!!",! G HCPCS
78 S (RMHCNEW,RMDAHC)=$P($G(^RMPR(661.3,RMLOC,1,+Y,0)),U,1)
79 I $G(RMDAHC),$P(^RMPR(661.1,RMDAHC,0),U,5)'=1 D INACT^RMPRSTI G HCPCS
80 S RMHCPC=$P(^RMPR(661.1,RMDAHC,0),U,1),RMHCDA=+Y
81 S RDES=$P(^RMPR(661.1,RMDAHC,0),U,2)
82 ;
83CPT ;ask for CPT Modifier
84 K DIC,Y,RQUIT
85 S RDA=RMDAHC_"^"_$P(R1(0),U,4)_"^"_$P(R1(0),U,14)_"^"_660
86 D:$D(RMCPT) CHK^RMPRED5
87 W:$G(REDIT) !,"OLD CPT MODIFIER: ",$P(R1(1),U,6)
88 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)
89 I RMHCOLD'="",(RMHCOLD=RMDAHC),$G(REDIT) D
90 .S DIR(0)="Y",DIR("A")="Would you like to Edit CPT MODIFIER Entry ",DIR("B")="N" D ^DIR Q:$D(DTOUT)!$D(DUOUT)
91 .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)
92 K DIR
93 ;
94 ;D ITEM^RMPR5NU1(REDIT,RMLOC,RMLOCOLD,RMDAHC,RMHCOLD,RMHCDA,RMIT)
95 ;
96ITEM ;ask for PSAS Item to to edit.
97 S DA(2)=RMLOC,DA(1)=RMHCDA K DIC,RMU3,RMUBA,RQUIT
98 S DIC("A")="Enter PSAS Item: ",DIC(0)="AEMNQ"
99 I RMDAHC=RMHCOLD S DIC("B")=$G(RMIT)
100 S DIC="^RMPR(661.3,"_DA(2)_",1,"_DA(1)_",1,"
101 D ^DIC I $D(DUOUT)!$D(DTOUT) G LOC
102 I X="" W !,"This is a mandatory field!!!",! G ITEM
103 S RMITDA=+Y,RMU3=$G(^RMPR(661.3,RMLOC,1,RMHCDA,1,RMITDA,0))
104 S RMUBA=$P(RMU3,U,2)
105 S (RMITNEW,RMIT)=$P(RMU3,U,1),RMDES=RMIT K DIC("B"),DIC("S")
106 I (RMITNEW'=RMITOLD),(RMUBA<1) D LOWBA^RMPRSTI G LOC
107 ;
108 I $D(RMLOC),$D(RMHCDA),$D(RMITDA) S RMSO=$$SOURCE^RMPR5NU1
109 I $D(RMSO),RMSO="" D MESSO^RMPRSTI G LOC
110 S:$D(RMSO) $P(R1(0),U,14)=RMSO
111 S $P(R3("D"),U,14)=$S(RMSO="C":"COMMERCIAL",RMSO="V":"VA",1:"")
112 I $P(R1(1),U,4)'="",$D(DUOUT) G CO
113 I $G(RMLOC),'($G(RMHCDA)&$G(RMITDA)) W !,"PSAS Item was not selected!!" G LOC
114 I $G(RMLOC),$G(RMHCDA),$G(RMITDA) S RMPRUCST=$$COST^RMPR5NU1
115 I '$G(RMPRUCST) D MESSI^RMPRSTI G LOC
116 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)
117 S $P(R1(1),U,4)=RMDAHC,$P(R1(0),U,22)=$P(^RMPR(661.1,RMDAHC,0),U,4)
118 S RMLOCNEW=RMLOC,RMHCNEW=RMDAHC
119 D NODE2^RMPRSTI
120 K DIC
121 ;
122VEN0 ;process vendor
123 K DIC,DIR
124 I $D(RMLOC),$D(RMHCDA),$D(RMITDA) S DIC("B")=$$VEND^RMPR5NU1
125 S DIC="^PRC(440,",DIC(0)="AEQM" D ^DIC I $D(DUOUT)!$D(DTOUT) G CO
126 G:+Y<0 VEN0
127 S $P(R1(0),U,9)=+Y,$P(R3("D"),U,9)=$P(Y,U,2) K DIR,DIC
128CP G ^RMPRED4
129 ;
130SET ;set the original variables.
131 S $P(R3("D"),U,14)=$S($P(R1(0),U,14)="V":"VA",$P(R1(0),U,14)="C":"COMMERCIAL",1:"")
132 S $P(R3("D"),U,4)=$S($P(R1(0),U,4)="I":"INITIAL ISSUE",$P(R1(0),U,4)="X":"REPAIR",$P(R1(0),U,4)="R":"REPLACE",$P(R1(0),U,4)="S":"SPARE",$P(R1(0),U,4)="5":"RENTAL",1:"")
133 S $P(R4("D"),U,3)=$S($P(R1("AM"),U,3)=1:"SC/OP",$P(R1("AM"),U,3)=2:"SC/IP",$P(R1("AM"),U,3)=3:"NSC/IP",$P(R1("AM"),U,3)=4:"NSC/OP")
134 S:$P(R1("AM"),U,3)=4&($P(R1("AM"),U,4)) $P(R4("D"),U,4)=$S($P(R1("AM"),U,4)=1:"SPECIAL LEGISLATION",$P(R1("AM"),U,4)=2:"A&A",$P(R1("AM"),U,4)=3:"PHC",$P(R1("AM"),U,4)=4:"ELIGIBILITY REFORM",1:"")
135 S RMHCOLD=$P($G(R1(1)),U,4),RMPRPF=$P(R1(0),U,13),RMQOLD=$P(R1(0),U,7)
136 S RMSO=$P(R1(0),U,14)
137 I $G(RMQOLD),$P($G(R1(0)),U,16) S RMPRUCST=$P(R1(0),U,16)/RMQOLD
138 S $P(R3("D"),U,6)=$P(^RMPR(661,$P(R1(0),U,6),0),U,1),RITOLD=$P(R1(0),U,6),RMQOLD=$P(R1(0),U,7),Y=$P(R1(0),U,12) G:Y="" CO D DD^%DT S $P(R3("D"),U,12)=Y
139 D ^RMPRST2 G DEL
140 Q
Note: See TracBrowser for help on using the repository browser.