source: FOIAVistA/tag/r/PROSTHETICS-RMPR-RMPO-RMPS/RMPR5NEE.m@ 1093

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

initial load of FOIAVistA 6/30/08 version

File size: 3.7 KB
Line 
1RMPR5NEE ;HIN/RVD-PROS INVENTORY EDIT UTILITY ;2/11/98
2 ;;3.0;PROSTHETICS;**33,37**;Feb 09, 1996
3 D DIV4^RMPRSIT I $D(Y),(Y<0) K DIC("B") Q
4 ;S RMKEY=$O(^DIC(19.1,"B","RMPRMANAGER",0))
5 S X="NOW" D ^%DT
6LOC ;ask for Location.
7 W @IOF,!!,"Editing an Inventory Item in a Location.....",! K DTOUT,DUOUT,DIC("B")
8 S DZ="??",D="B",DIC("S")="I $P(^RMPR(661.3,+Y,0),U,3)=RMPR(""STA"")"
9 S DIC="^RMPR(661.3,",DIC(0)="AEQM"
10 S D="B",DIC("A")="Enter Pros Location: " D MIX^DIC1
11 G:$D(DTOUT)!$D(DUOUT)!(Y'>0) EXIT S (DA,RMLODA)=+Y
12 L +^RMPR(661.3,RMLODA):2
13 I '$T W !,"Record in use. Try again later..." G LOC
14 S RML=$P(^RMPR(661.3,RMLODA,0),U,1)
15 S DIE=DIC,DR=".01" D ^DIE K DIE,DR
16 G:$D(Y)!'$D(^RMPR(661.3,RMLODA,0)) LOC
17 S RMLOC=$P(^RMPR(661.3,RMLODA,0),U,1),DIK=DIC W:RML'=RMLOC !,"Location has been edited from '"_RML_"' to '"_RMLOC_"' !!!"
18 I $P(^RMPR(661.3,RMLODA,0),U,3)="" S $P(^(0),U,3)=RMPR("STA") D IX1^DIK
19 L -^RMPR(661.3,RMLODA)
20 ;
21LIST ;list current HCPCS @ this Location
22 K DIC("S"),RMR,RMX S DIC("A")="Select HCPCS to EDIT: ",DA(1)=RMLODA
23 S DIC="^RMPR(661.3,"_DA(1)_",1,",DIC(0)="AEMQ",DIC("W")="S RZ=$P(^RMPR(661.3,RMLODA,1,+Y,0),U,1) I RZ W ?15,$P(^RMPR(661.1,RZ,0),U,2)"
24 D ^DIC I +Y'>0!$D(DTOUT)!$D(DUOUT) W !,"** No HCPCS selected..." H 1 G LOC
25 S RMDAHC=$P($G(^RMPR(661.3,RMLODA,1,+Y,0)),U,1),RMHCPC=$P(^RMPR(661.1,RMDAHC,0),U,1),RMHCDA=+Y
26 S DA(2)=RMLODA,DA(1)=RMHCDA K DIC
27ITEM ;ask for PSAS Item to to edit.
28 S DIC("A")="Enter PSAS Item to Edit: ",DIC(0)="AEMNQ"
29 S DIC="^RMPR(661.3,"_DA(2)_",1,"_DA(1)_",1,"
30 D ^DIC
31 G:Y'>0!$D(DTOUT)!$D(DUOUT) LOC
32 L +^RMPR(661.3,RMLODA,1,RMHCDA,1,+Y):2
33 I '$T W !,"Record in use. Try again later..." G LOC
34 ;
35 ;for item in 661.3
36 S (DA,RMITDA)=+Y,RDIC3=DIC K DIC("B")
37 S RM3=^RMPR(661.3,RMLODA,1,RMHCDA,1,RMITDA,0),RMIT=$P(RM3,U,1),RMDAIT=$P(RMIT,"-",2)
38 S RMITEM=$P(^RMPR(661.1,RMDAHC,3,RMDAIT,0),U,1)
39 S RMQU=$P(RM3,U,2),RMCO=$P(RM3,U,3) S:'RMQU RMQU=0 S:'RMCO RMCO=0
40 ;
41UPD ;updates item in 661.3
42 S (RMAVA,RMQUD,RMCOD)=0,DIE=RDIC3
43 S DR="29;22R;23R~TOTAL COST OF QUANTITY;24;25R;26;27"
44 D ^DIE
45 S RM3A=^RMPR(661.3,RMLODA,1,RMHCDA,1,RMITDA,0)
46 S RMQUA=$P(RM3A,U,2),RMCOA=$P(RM3A,U,3),RMAVA=$P(RM3A,U,10),RMSO=$P(RM3A,U,9)
47 I RMQUA=RMQU,RMCOA=RMCO G LOC
48 I (RMSO="C")&(RMCOA<.0001) G LIST
49 I RMSO="C" S:RMAVA<1&RMQUA>0 RMAVA=RMCOA/RMQUA
50 I RMCO'=RMCOA S RMCOD=RMCOA-RMCO
51 I RMQU'=RMQUA S RMQUD=RMQUA-RMQU
52 I RMQUD,'RMCOD S RMCOA=RMAVA*RMQUA
53 I 'RMQUD,RMCOD S:RMQUA>0 RMAVA=RMCOA/RMQUA
54 I RMQUD,RMCOD S:RMQUA>0 RMAVA=RMCOA/RMQUA
55 S $P(^RMPR(661.3,RMLODA,1,RMHCDA,1,RMITDA,0),U,3)=RMCOA
56 S $P(^RMPR(661.3,RMLODA,1,RMHCDA,1,RMITDA,0),U,8)=RMITEM
57 S $P(^RMPR(661.3,RMLODA,1,RMHCDA,1,RMITDA,0),U,10)=$J(RMAVA,0,2)
58 ;
59STAT ;create an item statistics for this event.
60 G:RMQU=RMQUA&(RMCO=RMCOA) LIST
61 D BAL^RMPR5NU1
62 L -^RMPR(661.3,RMLODA,1,RMHCDA,1,RMITDA)
63 K DD,DO S DIC="^RMPR(661.2,",DIC(0)="L",X=DT,DLAYGO=661.2 D FILE^DICN
64 G:$D(DTOUT)!(Y'>0) LIST S DA=+Y
65 S RMMESF="Edited by "_$E($P(^VA(200,DUZ,0),U,1),1,15)_": ("
66 S RMMESF=RMMESF_$S(RMQUD>0:"+"_RMQUD_")",1:RMQUD_")")
67 S ^RMPR(661.2,DA,0)=DT_"^^^"_RMDAHC_"^^^"_DUZ_"^"_RMQUD_"^"_RMIT_"^^^"_RMTOBA_"^"_RMMESF_"^"_$J(RMTOCO,0,2)_"^"_RMPR("STA")_"^"_RMLODA_"^"_$J(RMAVA,0,2) S DIK=DIC D IX1^DIK
68 W !!,"** Item ",RMITEM," was ",RMMESF," @ Location ",RMLOC
69 H 2 G LIST
70 ;
71DEL ;delete a location
72 S DIR(0)="Y",DIR("B")="N"
73 W !,"This will DELETE all HCPCS and ITEMS under this LOCATION..."
74 S DIR("A")="Are you sure you want to DELETE this LOCATION (Y/N) "
75 D ^DIR I $D(DTOUT)!$D(DUOUT) S RMX=RMR("B") S:Y="^" RMEXIT=1 Q
76 L +^RMPR(661.3,RMLODA):2
77 I '$T W !,"Record in use. Try again later..." S RMEXIT=1 Q
78 I Y>0 S DIK="^RMPR(661.3,",DA=RMLODA D ^DIK W:'$D(^RMPR(661.3,RMLODA,0)) !,"Location is deleted!!!!" H 2 K DIR,DIK,X
79 Q
80 ;
81EXIT ;MAIN EXIT POINT
82 N RMPR,RMPRSITE D KILL^XUSCLEAN
83 Q
Note: See TracBrowser for help on using the repository browser.