source: WorldVistAEHR/trunk/r/PROSTHETICS-RMPR-RMPO-RMPS/RMPRPIXR.m@ 1042

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

initial load of WorldVistAEHR

File size: 4.9 KB
RevLine 
[613]1RMPRPIXR ;HINES OIFO/ODJ - REMOVE/DEACTIVATE ITEM ;12/11/02 10:22
2 ;;3.0;PROSTHETICS;**61**;Feb 09, 1996
3 Q
4 ;
5RE ;remove/deactivate an HCPCS/ITEM
6 ;***** STN - prompt for Site/Station
7STN S RMPRERR=$$STN^RMPRPIY1(.RMPRSTN,.RMPREXC)
8 I RMPRERR G DLX
9 I RMPREXC'="" G DLX
10 W !!,"*** Removing/Deactivating HCPCS......",!
11 ;
12HCPCS ;
13 K ^TMP($J),Y,DIR
14 K RMPR1,RMPR11,RMPR5,RMPRLCN,RMPREXC,RMPRERR,RMPRUNI,RMDEL,RMOUT
15 W !
16 S RMPR1("REMOVE")=1
17 D HCPCS^RMPRPIY7(RMPRSTN("IEN"),$G(RMPR1("HCPCS")),.RMPR1,.RMPR11,.RMPREXC)
18 I RMPREXC="T" G DLX
19 I RMPREXC="P" G STN
20 I RMPREXC="^" D G DLX
21 . W !,"** No HCPCS selected." H 1
22 S RS=RMPRSTN("IEN"),RH=RMPR1("HCPCS")
23 ;
24ALL ;ask if all item will be remove/deactivate
25 S DIR(0)="Y",DIR("B")="N"
26 W !
27 S DIR("A")="Do you want to Remove/Deactivate ALL Items for this HCPCS"
28 D ^DIR
29 I $D(DTOUT)!$D(DUOUT)!(Y="^") W !!,"Nothing Remove.." G HCPCS
30 I Y=1 S RMDEL="ALL" D I $G(RMOUT) H 2 G HCPCS
31 .S DIR(0)="Y",DIR("B")="N"
32 .W !
33 .S DIR("A")="Are you sure you want to Remove/Deactivate ALL ITEMs for HCPCS "_RMPR1("HCPCS")
34 .D ^DIR
35 .I $D(DTOUT)!$D(DUOUT)!(Y="^")!(Y=0) W !!,"Nothing Remove.." S RMOUT=1
36 G:$D(RMDEL) ZERO
37 ;
38ITEM ;
39 D ITEM^RMPRPIYP(RMPRSTN("IEN"),$G(RMPR1("HCPCS")),.RMPR11,.RMPREXC)
40 I RMPREXC="T" G DLX
41 I RMPREXC="P" G HCPCS
42 I RMPREXC="^" G HCPCS
43 ;
44 S DIR(0)="Y",DIR("B")="N"
45 W !
46 S DIR("A")="Are you sure you want to Remove/Deactivate this HCPCS/ITEM "_RMPR11("HCPCS-ITEM")
47 D ^DIR
48 I $D(DTOUT)!$D(DUOUT)!(Y="^")!(Y=0) W !!,"Nothing Remove.." G HCPCS
49 ;
50ZERO ;zero out
51 ;only delete one if item if specified
52 I $D(RMPR11("ITEM")) G DEL1
53 G:$D(RMDEL) ALLIT
54 ;
55DEL1 ;remove one item
56 ;
57 S RI=RMPR11("ITEM")
58 F RD=0:0 S RD=$O(^RMPR(661.7,"XSHIDS",RS,RH,RI,RD)) Q:RD'>0 F RIEN=0:0 S RIEN=$O(^RMPR(661.7,"XSHIDS",RS,RH,RI,RD,1,RIEN)) Q:RIEN'>0 D
59 .Q:'$D(^RMPR(661.7,RIEN,0))
60 .S RMDA=^RMPR(661.7,RIEN,0)
61 .S RML=$P(RMDA,U,6),RMQ=$P(RMDA,U,7),RMV=$P(RMDA,U,8)
62 .;call update 661.6
63 .S RMPR11("HCPCS")=RH,RMPR11("ITEM")=RI,RMPR11("STATION")=RS
64 .S RMPR6("COMMENT")="",RMPR6("LOCATION")="",RMPR6("QUANTITY")=0
65 .S RMPR6("SEQUENCE")=0,RMPR6("TRAN TYPE")=9,RMPR6("USER")=$G(DUZ)
66 .S RMPR6("VALUE")=0,RMPR6("VENDOR")=""
67 .S RMERR=$$CRE^RMPRPIX6(.RMPR6,.RMPR11)
68 .;delete entry in #661.7
69 .Q:'$G(RIEN)
70 .K DIK S DIK="^RMPR(661.7,",DA=RIEN D ^DIK
71 .;update 661.9
72 .K R9,R9DA
73 .I $D(^RMPR(661.9,"ASHID",RS,RH,RI,DT)) D
74 ..S R9=$O(^RMPR(661.9,"ASHID",RS,RH,RI,DT,""),-1)
75 ..I $G(R9),$D(^RMPR(661.9,R9,0)) S R9DA=^RMPR(661.9,R9,0)
76 ..I $D(R9DA),$P(R9DA,U,8)=0 Q
77 ..D UP9
78 .I '$D(^RMPR(661.9,"ASHID",RS,RH,RI,DT)) D UP9
79 .S RHRI=RH_"-"_RI
80 .S ^TMP($J,RHRI)=""
81 ;print a message to the screen for items being removed
82 D MESS
83 ;change status of hcpcs & deactivation date in 661.11
84 K RMERR,RMDAT,K
85 S RMDAT(661.11,RMPR11("IEN")_",",8)=1
86 S RMDAT(661.11,RMPR11("IEN")_",",9)=DT
87 D FILE^DIE("K","RMDAT","RMERR")
88 I $D(RMERR) W !!,"*** Error updating file #661.11 update!!!",!!
89 G HCPCS
90 ;
91ALLIT ;remove/deactivate all items for selected HCPCS.
92 ;
93 F RI=0:0 S RI=$O(^RMPR(661.7,"XSHIDS",RS,RH,RI)) Q:RI'>0 D
94 .F RD=0:0 S RD=$O(^RMPR(661.7,"XSHIDS",RS,RH,RI,RD)) Q:RD'>0 F RIEN=0:0 S RIEN=$O(^RMPR(661.7,"XSHIDS",RS,RH,RI,RD,1,RIEN)) Q:RIEN'>0 D
95 ..Q:'$D(^RMPR(661.7,RIEN,0))
96 ..S RMDA=^RMPR(661.7,RIEN,0)
97 ..S RML=$P(RMDA,U,6),RMQ=$P(RMDA,U,7),RMV=$P(RMDA,U,8)
98 ..;update 661.6
99 ..S RMPR11("HCPCS")=RH,RMPR11("ITEM")=RI,RMPR11("STATION")=RS
100 ..S RMPR6("COMMENT")="",RMPR6("LOCATION")="",RMPR6("QUANTITY")=0
101 ..S RMPR6("SEQUENCE")=0,RMPR6("TRAN TYPE")=9,RMPR6("USER")=$G(DUZ)
102 ..S RMPR6("VALUE")=0,RMPR6("VENDOR")=""
103 ..S RMERR=$$CRE^RMPRPIX6(.RMPR6,.RMPR11)
104 ..;delete entry from #661.7
105 ..Q:'$G(RIEN)
106 ..K DIK S DIK="^RMPR(661.7,",DA=RIEN D ^DIK
107 ..; update 661.9
108 K R9,R9DA
109 F RI=0:0 S RI=$O(^RMPR(661.9,"ASHID",RS,RH,RI)) Q:RI'>0 D UP9
110 ;
111 ;print a message of items being removed/deactivated
112 F I=0:0 S I=$O(^RMPR(661.11,"ASHI",RS,RH,I)) Q:I'>0 D
113 .F J=0:0 S J=$O(^RMPR(661.11,"ASHI",RS,RH,I,J)) Q:J'>0 D
114 ..S RHRI=RH_"-"_I
115 ..S ^TMP($J,RHRI)=""
116 D MESS
117 ;change status of hcpcs & deactivation date in 661.11
118 ;loop through all items in a particular HCPCS
119 F RI=0:0 S RI=$O(^RMPR(661.11,"ASHI",RS,RH,RI)) Q:RI'>0 D
120 .F RJ=0:0 S RJ=$O(^RMPR(661.11,"ASHI",RS,RH,RI,RJ)) Q:RJ'>0 D
121 ..K RMERR,K,RMDAT
122 ..S RMDAT(661.11,RJ_",",8)=1
123 ..S RMDAT(661.11,RJ_",",9)=DT
124 ..D FILE^DIE("K","RMDAT","RMERR")
125 ..I $D(RMERR) W !!,"*** Error updating file #661.11 update!!!",!!
126 ;ask for another HCPCCS to remove
127 G HCPCS
128 ;
129UP9 ;CREATE entry in file #661.9
130 K RMDAT,RMERR,RIN
131 S RMDAT(661.9,"+1,",.01)=DT
132 S RMDAT(661.9,"+1,",1)=RH
133 S RMDAT(661.9,"+1,",2)=RI
134 S RMDAT(661.9,"+1,",4)=RS
135 S RMDAT(661.9,"+1,",7)=0
136 S RMDAT(661.9,"+1,",8)=0
137 D UPDATE^DIE("","RMDAT","RIN","RMERR")
138 I $D(RMERR) W !!,"*** Error updating file #661.9 !!!",!!
139 Q
140 ;
141MESS ;print a deleted message
142 S I="" F S I=$O(^TMP($J,I)) Q:I="" D
143 .W !!,"*** HCPCS/ITEM "_I_" has been Removed/Deactivated from PIP..."
144 K ^TMP($J)
145 Q
146 ;
147DLX N RMPR,RMPRSITE D KILL^XUSCLEAN
148 Q
Note: See TracBrowser for help on using the repository browser.