source: FOIAVistA/tag/r/PROSTHETICS-RMPR-RMPO-RMPS/RMPR9S7.m@ 1424

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

initial load of FOIAVistA 6/30/08 version

File size: 4.1 KB
Line 
1RMPR9S7 ;HOIFO/HNC - GUI 2319 TAB 7 HISA TRANSACTIONS LIST ;9/10/02 08:43
2 ;;3.0;PROSTHETICS;**59**;Feb 09, 1996
3 ;
4 Q
5A1(IEN) G A2
6EN(RESULTS,IEN) ;broker
7A2 S (RA,AN,ANS,RK,RZ)=0 K ^TMP($J,"TT"),^TMP($J,"AG"),IT
8 K ^TMP($J,"RMPRB")
9 K ^TMP($J,"RMPRC")
10 ;IT IS RESULTS
11 ;0;2 DFN in 668
12 S RMPRDFN=$P($G(^RMPR(668,IEN,0)),U,2)
13 I RMPRDFN="" S ^TMP($J,"RMPRB",1)="PATIENT NOT KNOWN" Q
14 MERGE ^TMP($J,"TT")=^RMPR(660,"AC",RMPRDFN)
15 S B=0
16 F S B=$O(^TMP($J,"TT",B)) Q:B'>0 D
17 . S BC=0
18 . F S BC=$O(^TMP($J,"TT",B,BC)) Q:BC'>0 D
19 . .;Q:$P($G(^RMPR(660,BC,0)),U,10)'=RMPR("STA")
20 . .S GN=$P($G(^RMPR(660,BC,"AMS")),U,1)
21 . .S ND=$P($G(^RMPR(660,BC,1)),U,4)
22 . .I ND S ND=$P(^RMPR(661.1,ND,0),U,8)
23 . .S:ND="" ND=2
24 . .S:GN="" GN=BC
25 . .S ^TMP($J,"AG",GN,ND,BC)=B
26 S B=""
27 F S B=$O(^TMP($J,"AG",B)) Q:B'>0 D
28 .S BC=""
29 .F S BC=$O(^TMP($J,"AG",B,BC)) Q:BC'>0 D
30 . .Q:BC=2
31 . .MERGE ^TMP($J,"AGG")=^TMP($J,"AG",B)
32 . .S HC="",GTCST=0
33 . .K HCC1
34 . .F S HC=$O(^TMP($J,"AGG",HC)) Q:HC'>0 D
35 . . .S HCC=0
36 . . .;changes for Surgical Implants
37 . . .S BDC=""
38 . . .F BDC=1:1 S HCC=$O(^TMP($J,"AGG",HC,HCC)) Q:HCC'>0 D
39 . . . .S GTCST=GTCST+$P(^RMPR(660,HCC,0),U,16)
40 . . . .I BDC=1&(HC'=2) S HCC1=HCC
41 . . . .I BDC'=1 K ^TMP($J,"TT",^TMP($J,"AGG",HC,HCC),HCC)
42 . . . .I HC=2 K ^TMP($J,"TT",^TMP($J,"AGG",HC,HCC),HCC)
43 . .I $G(HCC1) S $P(^TMP($J,"TT",^TMP($J,"AGG",1,HCC1),HCC1),U,3)=GTCST K HCC1
44 . .K GTCST,^TMP($J,"AGG")
45 K ^TMP($J,"AG"),BDC
46 S B=0,RC=1
47 F S B=$O(^TMP($J,"TT",B)) Q:B'>0 D
48 .S RK=0
49 .F S RK=$O(^TMP($J,"TT",B,RK)) Q:RK'>0 D
50 . .Q:$D(^RMPO(665.72,"AC",RK))
51 . .S ^TMP($J,"RMPRC",RC)=RK
52 . .I $P(^TMP($J,"TT",B,RK),U,3) S $P(^TMP($J,"RMPRC",RC),U,3)=$P(^TMP($J,"TT",B,RK),U,3)
53 . .S RC=RC+1
54 S RK=0,RZ=0
55 K ^TMP($J,"TT"),B
56 ;
57 G:'$D(^TMP($J,"RMPRC")) END
58 ;
59DIS ;format data string - only HISA
60 S RC=""
61 S RK=1
62 F S RK=$O(^TMP($J,"RMPRC",RK)) Q:RK="" D
63 .S AN=+^TMP($J,"RMPRC",RK)
64 .S Y=^RMPR(660,AN,0)
65 .D PRT
66 ;
67END ;I RC=0 S ^TMP($J,"RMPRB",0)="NOTHING TO REPORT" G EXIT
68 ;
69 ;
70EXIT ;common exit point
71 K ^TMP($J,"RMPRC")
72 ;pass to broker
73 ;S RESULT=$NA(^TMP($J))
74 M RESULTS=^TMP($J,"RMPRB")
75 I '$D(RESULTS) S RESULTS(0)="NOTHING TO REPORT"
76 K I,J,L,R0,RA
77 Q
78 ;
79 Q
80PRT S DATE=$P(Y,U,3),TYPE=$P(Y,U,6),QTY=$P(Y,U,7)
81 S VEN=$P(Y,U,9),TRANS=$P(Y,U,4),STA=$P(Y,U,10),SN=$P(Y,U,11)
82 S DEL=$P(Y,U,12)
83 S CST=$S($P(Y,U,16)'="":$P(Y,U,16),$D(^RMPR(660,AN,"LB")):$P(^RMPR(660,AN,"LB"),U,9),1:"")
84 ;lab source of procurement
85 I $D(^RMPR(660,AN,"LB")) S RMPRLPRO=$P(^("LB"),U,3) D
86 .I RMPRLPRO="O" S RMPRLPRO="ORTHOTIC" Q
87 .I RMPRLPRO="R" S RMPRLPRO="RESTORATION" Q
88 .I RMPRLPRO="S" S RMPRLPRO="SHOE" Q
89 .I RMPRLPRO="W" S RMPRLPRO="WHEELCHAIR" Q
90 .I RMPRLPRO="N" S RMPRLPRO="FOOT CENTER" Q
91 .I RMPRLPRO="D" S RMPRLPRO="DDC" Q
92 ;form requested on
93 S FRM=$P(Y,U,13),REM=$P(Y,U,18)
94 S DATE=$E(DATE,4,5)_"/"_$E(DATE,6,7)_"/"_$E(DATE,2,3)
95 S TYPE=$S(TYPE="":"",$D(^RMPR(661,TYPE,0)):$P(^(0),U,1),1:""),AMIS=$P(Y,U,15),VEN=$S(VEN="":"",$D(^PRC(440,VEN,0)):$P(^(0),U,1),1:"")
96 I $D(^RMPR(660.1,"AC",AN)),$P(^RMPR(660.1,$O(^RMPR(660.1,"AC",AN,0)),0),U,11)]"" S AMIS=AMIS_"+"
97 S TRANS=$S(TRANS]"":TRANS,1:""),TRANS1="" S:TRANS="X" TRANS1=TRANS,TRANS=""
98 S DEL=$E(DEL,4,5)_"/"_$E(DEL,6,7)_"/"_$E(DEL,2,3) S:DEL="//" DEL=""
99 ;
100 ;set results array
101 ;
102 S ITEM=$S(TYPE'="":$P(^PRC(441,TYPE,0),U,2),$P(Y,U,26)="D":"DELIVERY",$P(Y,U,26)="P":"PICKUP",$P(Y,U,17):"SHIPPING",1:"")
103 ;
104 S HCPCS=$P($G(^RMPR(660,$P(^TMP($J,"RMPRC",RK),U,1),1)),U,4)
105 I HCPCS'="" S HCPCS=$P($G(^RMPR(661.1,HCPCS,0)),U,1)
106 Q:HCPCS'["HISA"
107 S ^TMP($J,"RMPRB",RK)=$P(^TMP($J,"RMPRC",RK),U,1)_U_DATE_U_QTY_U_ITEM
108 S ^TMP($J,"RMPRB",RK)=^TMP($J,"RMPRB",RK)_U_HCPCS_U_TRANS_TRANS1
109 ;
110 ;display source of procurement for 2529-3 under vendor header
111 I $D(RMPRLPRO) S ^TMP($J,"RMPRB",RK)=^TMP($J,"RMPRB",RK)_U_RMPRLPRO
112 I '$D(RMPRLPRO),VEN'="" S ^TMP($J,"RMPRB",RK)=^TMP($J,"RMPRB",RK)_U_$E(VEN,1,10)
113 K RMPRLPRO
114 ;
115 S ^TMP($J,"RMPRB",RK)=^TMP($J,"RMPRB",RK)_U_$P($G(^DIC(4,STA,99)),U,1)_U_SN_U_DEL
116 I $P(^TMP($J,"RMPRC",RK),U,3) S CST=$P(^TMP($J,"RMPRC",RK),U,3)
117 S COST=$J($FN($S(CST'="":CST,$P(Y,U,17):$P(Y,U,17),1:""),"T",2),9)
118 ;
119 S ^TMP($J,"RMPRB",RK)=^TMP($J,"RMPRB",RK)_U_COST_U_REM
120 ;
121 I $P(^TMP($J,"RMPRC",RK),U,2)="" S $P(^TMP($J,"RMPRC",RK),U,2)=RZ
122 ;
123 Q
124 ;END
Note: See TracBrowser for help on using the repository browser.