source: FOIAVistA/trunk/r/PROSTHETICS-RMPR-RMPO-RMPS/RMPR29U.m@ 868

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

initial load of FOIAVistA 6/30/08 version

File size: 7.0 KB
Line 
1RMPR29U ;PHX/JLT-2529-3 UTILITIES[ 11/28/94 3:55 PM ]
2 ;;3.0;PROSTHETICS;**2,41,50,62**;Feb 09, 1996
3 ;
4 ; ODJ - patch 50 - 7/17/00 nois STL-0400-42007
5 ; In POST subroutine ensure that if a 660 pointer
6 ; in a 664.2 record points to non-existant 660 the
7 ; routine does not crash.
8 ; RVD patch #62 - PCE and suspense link.
9 ;
10ST ;DISPLAY ASSIGNED WORK ORDER
11 S DIE="^RMPR(664.1,",DA=RMPRDA,DR="27////^S X=DUZ;15////^S X=PEMP;16///A" D ^DIE
12 ;W !!,?5,"Work Order Number: ",RMPRWO,!,?5,"Assigned to: ",$P($P(^VA(200,+PEMP,0),U,1),",",2)_" "_$P($P(^VA(200,+PEMP,0),U,1),",",1) Q
13 Q
14INVD(INVP,IVIT) ;GET DEFAULTS FOR INVENTORY ITEM
15 ;SEE DBA #698 ; CUSTODIAL PACKAGE - IFCAP ;CUSTODIAL ISC - WASHINGTON
16 N DIC,Y,DA S DIC="^PRCP(445,"_INVP_",1,",DA(1)=INVP,DIC(0)="MNZ",X=IVIT D ^DIC I +Y'>0 S (VEN,COST)="" Q
17 S VEN=$S($G(VEN)="":$P(Y(0),U,12),1:VEN),COST=$P(Y(0),U,15) I +VEN,$D(^PRC(440,+VEN,0)) S VEN=$P(^(0),U,1)
18 Q
19ITV(VEN,ITM) ;GET DEFAULT VENDOR FOR ITEM
20 ;SEE DBA #801 ; CUSTODIAL PACKAGE - IFCAP ; CUSTODIAL ISC - WASHINGTON
21 N DIC,Y S VEN=$S($P(^PRC(441,ITM,0),U,8):$P(^(0),U,8),1:$O(^PRC(441,ITM,2,"B",0))) I 'VEN S VDR="" Q
22 S DIC="^PRC(441,"_ITM_",2,",DA(1)=ITM,DIC(0)="MNZ",X=VEN D ^DIC I +Y>0 S VDR=Y(0,0)
23 E S VDR=""
24 Q
25ITC(VEN,ITM) ;DEFAULT COST FOR ITEM
26 ;SEE DBA # 801 ; CUSTODIAL PACKAGE - IFCAP ; CUSTODIAL ISC - WASHINGTON
27 N DIC,Y I VEN="" S VEN=$S($P(^PRC(441,ITM,0),U,8):$P(^(0),U,8),1:$O(^PRC(441,ITM,2,"B",0))) I 'VEN S COST="" Q
28 S DIC="^PRC(441,"_ITM_",2,",DA(1)=ITM,DIC(0)="MNZ",X=VEN D ^DIC I +Y>0 S COST=$P(Y(0),U,2)
29 E S COST=""
30 Q
31POST ;POST JOB SECTION TO 2319
32 S (TCST,THRS,TLCST,CST,HRS,LCST,RHR,RLM)=0,DA660=+$P(^RMPR(664.2,RMPRWO,0),U,2),RWK=$P(^(0),U),RMPRSH=$S($P(^(0),U,7):$P(^(0),U,7),1:$P(^(0),U,6)),RMPRCD=$P(^RMPR(664.2,RMPRWO,0),U,10)
33 ;added by #62
34 I $G(DA660),'$D(^RMPR(660,DA660,10)) D
35 .S (RMPCAMIS,RMPRDFN)=""
36 .S RMPCAMIS=$G(^RMPR(660,DA660,"AMS"))
37 .S:$D(^RMPR(660,DA660,0)) RMPRDFN=$P(^RMPR(660,DA660,0),U,2)
38 .I RMPCAMIS,RMPRDFN S ^TMP($J,"RMPRPCE",660,DA660)=RMPCAMIS_"^"_RMPRDFN
39 F RI=0:0 S RI=$O(^RMPR(664.2,RMPRWO,1,RI)) Q:RI'>0 I $D(^(RI,0)) S CST=$P(^(0),U,3),QTY=$P(^(0),U,2) S CST=$J(CST*QTY,0,2),TCST=TCST+CST
40 F RI=0:0 S RI=$O(^RMPR(664.3,"C",DA660,RI)) Q:RI'>0 I $D(^RMPR(664.3,RI,0)) F RT=0:0 S RT=$O(^RMPR(664.3,RI,1,RT)) Q:RT'>0 D
41 .S HRS=$P(^RMPR(664.3,RI,1,RT,0),U,2),LCST=$P(^(0),U,3),LCST=$J(HRS*LCST,0,2),TLCST=TLCST+LCST,RHR=RHR+$P(HRS,"."),RLM=RLM+$P(HRS,".",2)
42 .S THRS=THRS+HRS
43 ;
44 ; p50 - if 660 record does not exist permit LB section to be created
45 ; in case need to refer to costs of work done on canceled requests
46 S $P(^RMPR(660,DA660,"LB"),U,6)=THRS,$P(^("LB"),U,7)=$J(TLCST,0,2),$P(^("LB"),U,8)=$J(TCST+RMPRSH,0,2),$P(^("LB"),U,9)=$J(TLCST+TCST+RMPRSH,0,2)
47 S $P(^RMPR(660,DA660,"LB"),U,11)=RMPRCD
48 ;
49 ; p50 - only update 660 0rec if already exists (ie not canceled)
50 I DA660,$D(^RMPR(660,DA660,0)) D
51 . S RDEL=$P(^RMPR(660,DA660,0),U,12),$P(^(0),U,12)=RMPRCD
52 . K:RDEL ^RMPR(660,"CT",RDEL,DA660),^RMPR(660,"CD",RDEL,DA660)
53 . I RMPRCD S DA=DA660,DIE="^RMPR(660,",DR="83///@" D ^DIE
54 . S DA=DA660,DIK="^RMPR(660," D IX^DIK
55 . Q
56 S RMPRDA=$O(^RMPR(664.1,"C",RWK,0)),DA=$O(^RMPR(664.1,"AC",RMPRDA,DA660,0)) I +DA S $P(^RMPR(664.1,RMPRDA,2,DA,0),U,4)=$J(TCST+RMPRSH,0,2),$P(^(0),U,11)=$J(TLCST+TCST+RMPRSH,0,2)
57 Q
58EN4(RDA) ;CREATE JOB RECORD
59 S RMPR("REF")=$P(^RMPR(664.1,RDA,0),U,4),$P(^(0),U,20)="",RN=+$P(^(0),U,24)
60 K DIC,Y F RT=0:0 S RT=$O(^RMPR(664.1,RDA,2,RT)) Q:RT'>0 I $D(^(RT,0)) S DA660=$P(^(0),U,5) I +DA660,'$D(^RMPR(664.2,"C",DA660)) D S $P(^RMPR(664.1,RDA,0),U,24)=RN
61 .K DA,D0,DD,DO S DIC="^RMPR(664.2,",DIC(0)="LZ",X=$P(^RMPR(664.1,RDA,0),U,13) D FILE^DICN Q:+Y'>0
62 .S RN=RN+1,$P(^RMPR(664.2,+Y,0),U,2)=DA660,$P(^(0),U,3)=RMPR("STA"),$P(^(0),U,4)=RN,$P(^(0),U,8)=RMPR("REF") S DA=+Y,DIK="^RMPR(664.2," D IX1^DIK I $D(^RMPR(660,DA660,0)) D
63 ..S $P(^RMPR(660,DA660,"LB"),U,5)=DA,$P(^RMPR(664.1,RDA,2,RT,0),U,6)=DA,DA=DA660,DIE="^RMPR(660,",DR="83///^S X=$P(^RMPR(664.1,RDA,0),U,1)" D ^DIE
64 Q
65CR(SCR) ;CREATE WORK ORDER
66 N DIC,Y,DIR S RMPRWO=1 D FQ^RMPRDT Q:'$D(RMPRFY)!('$D(RMPRQTR)) S:'$D(RMPRTMP) RMPRWO=$$STAN^RMPR31U(RMPR("STA"))_"-"_RMPRFY_"-"_RMPRQTR I $D(RMPRTMP) D
67 .S RMPRWO=$$STAN^RMPR31U($P(^RMPR(664.1,RMPRDA,0),U,15))_"T-"_RMPRFY_"-"_RMPRQTR
68 I '$D(^RMPR(669.1,"B",RMPRWO)) S DIC="^RMPR(669.1,",DLAYGO=669.1,DIC(0)="LZ",X=RMPRWO D FILE^DICN K DLAYGO
69 S RDA=$O(^RMPR(669.1,"B",RMPRWO,0)) Q:'RDA
70 L +^RMPR(669.1,RDA,0):1 I '$T W !!,$C(7),"Someone is editing this record!" G EXIT
71 S RN=$P(^RMPR(669.1,RDA,0),U,2)+1 F I=1:1:4-$L(RN) S RN="0"_RN
72 S RMPRWO=RMPRWO_"-"_SCR_"-"_RN
73 S $P(^RMPR(669.1,RDA,0),U,2)=RN L -^RMPR(669.1,RDA,0) Q
74ITA(RY) ;CHK FOR AMIS CODE PASS Y AND RMPRDA
75 Q:'$D(RMPRDA) Q:$P($G(^RMPR(664.1,RMPRDA,0)),U,15)'=RMPR("STA") N Y,X,DIC,DR,DIE,DA,DIRUT,DTOUT,SCR K FLA
76 S SCR=$P(^RMPR(664.1,RMPRDA,0),U,11) S DR=$S(SCR'="R":"1;2;3;4",1:"1;2;5;6") I SCR="W" S DR="1;2;4"
77 I SCR'="R",'$P(^RMPR(661,RY,0),U,5),('$P(^(0),U,6)) W !!,$C(7),"Orthotic Lab AMIS Codes have not been entered for this item" S FLA=1
78 I SCR="R",'$P(^RMPR(661,RY,0),U,7),('$P(^(0),U,8)) W !!,$C(7),?5,"Restoration AMIS Codes have not been entered for this item" S FLA=1
79 I $D(FLA) S DIR(0)="Y",DIR("A")="Would You like to enter them now",DIR("B")="Y" D ^DIR Q:$D(DIRUT)!($D(DTOUT))!(+Y'>0) K Y,X S DA=RY,DIE="^RMPR(661," D ^DIE
80 K FLA Q
81PAID(EMP) ;GET PAID LABOR HOURS
82 ;CALLED BY RMPR29B
83 ;VARIABLES REQUIRED: EMP - ENTRY NUMBER FOR EMPLOYEE IN FILE 200
84 ;VARIABLE SET : RMPR450 - GET HOURLY WAGE RATE.
85 ;this call is no longer being used, trying to clean up!
86 Q 0
87 ; REWRITE ACCORDING TO SAC
88AUL ;check for lab or clinic
89 ;this input transform is no longer going to be supported, remove
90 ;by version 4.
91 ;
92 ;I '$D(RMPR)!('$D(RMPRSITE)) K X Q
93 ;I X'=RMPR("STA") W !!,?5,$C(7),"VAF 10-2529-3 request cannot be processed locally" K X Q
94 ;I '$P($G(^RMPR(669.9,$G(RMPRSITE),0)),U,6) W !!,?5,$C(7),"You cannot process VAF 10-2529-3 work orders." K X Q
95 Q
96EXIT N RMPR,RMPRSITE K ^TMP($J,"RMPRPCE") D KILL^XUSCLEAN Q
97CHKCPT(RDATA) ;check for cpt modifier - change of Type of Transaction.
98 N RMHCPC,RMCPT,RMCI,RMC,RMCLEN,RMLPIECE,RMF,RMFPIECE,RMTYPE,RMPRA,R4DA
99 S RMTYPE=$P(RDATA,U,1),RMPRA=$P(RDATA,U,2),R4DA=$P(RDATA,U,3)
100 S RMHCPC=$P($G(^RMPR(664.1,RMPRA,2,R4DA,2)),U,1)
101 S RMCPT=$P($G(^RMPR(664.1,RMPRA,2,R4DA,2)),U,2) Q:'$G(RMHCPC)
102 I ((RMTYPE="R")!(RMTYPE="X")),(RMCPT'["RP"),($G(^RMPR(661.1,RMHCPC,4))["RP") D ADDRP
103 I ((RMTYPE="I")!(RMTYPE="S")),(RMCPT["RP") D DELRP
104 K RMHCPC,RMCI,RMC,RMCLEN,RMLPIECE,RMF,RMFPIECE,RMTYPE,RMPRA,R4DA Q
105 ;return to (-3) ADD/EDIT option
106DELRP ;logic for deleting 'RP' modifier with transaction change.
107 F RMCI=1:1:8 S RMC=$P(RMCPT,",",RMCI) I RMC="RP" S $P(RMCPT,",",RMCI)="" D
108 .S RMF=$F(RMCPT,",,"),RMFPIECE=$E(RMCPT,1,RMF-2)
109 .S RMLPIECE=$E(RMCPT,RMF,32),RMCPT=RMFPIECE_RMLPIECE,RMCLEN=$L(RMCPT)
110 .I $E(RMCPT,1)="," S RMCPT=$E(RMCPT,2,RMCLEN)
111 .I $E(RMCPT,RMCLEN)="," S RMCPT=$E(RMCPT,1,RMCLEN-1)
112 .S $P(^RMPR(664.1,RMPRA,2,R4DA,2),U,2)=RMCPT
113 Q
114 ;
115ADDRP ;logic for adding 'RP' modifier with transaction change.
116 S RMCPT=RMCPT_",RP" S $P(^RMPR(664.1,RMPRA,2,R4DA,2),U,2)=RMCPT
117 Q
Note: See TracBrowser for help on using the repository browser.