source: WorldVistAEHR/trunk/r/PROSTHETICS-RMPR-RMPO-RMPS/RMPR9S8.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: 4.2 KB
Line 
1RMPR9S8 ;HOIFO/HNC - GUI 2319 TAB 8 HOME OXYGEN TRANSACTIONS LIST ;9/10/02 08:43
2 ;;3.0;PROSTHETICS;**59,99**;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 . .;home oxygen
21 . .Q:'$D(^RMPO(665.72,"AC",BC))
22 . .S GN=$P($G(^RMPR(660,BC,"AMS")),U,1)
23 . .S ND=$P($G(^RMPR(660,BC,1)),U,4)
24 . .I ND S ND=$P(^RMPR(661.1,ND,0),U,8)
25 . .S:ND="" ND=2
26 . .S:GN="" GN=BC
27 . .S ^TMP($J,"AG",GN,ND,BC)=B
28 S B=""
29 F S B=$O(^TMP($J,"AG",B)) Q:B'>0 D
30 .S BC=""
31 .F S BC=$O(^TMP($J,"AG",B,BC)) Q:BC'>0 D
32 . .Q:BC=2
33 . .MERGE ^TMP($J,"AGG")=^TMP($J,"AG",B)
34 . .S HC="",GTCST=0
35 . .K HCC1
36 . .F S HC=$O(^TMP($J,"AGG",HC)) Q:HC'>0 D
37 . . .S HCC=0
38 . . .;changes for Surgical Implants
39 . . .S BDC=""
40 . . .F BDC=1:1 S HCC=$O(^TMP($J,"AGG",HC,HCC)) Q:HCC'>0 D
41 . . . .S GTCST=GTCST+$P(^RMPR(660,HCC,0),U,16)
42 . . . .I BDC=1&(HC'=2) S HCC1=HCC
43 . . . .I BDC'=1 K ^TMP($J,"TT",^TMP($J,"AGG",HC,HCC),HCC)
44 . . . .I HC=2 K ^TMP($J,"TT",^TMP($J,"AGG",HC,HCC),HCC)
45 . .I $G(HCC1) S $P(^TMP($J,"TT",^TMP($J,"AGG",1,HCC1),HCC1),U,3)=GTCST K HCC1
46 . .K GTCST,^TMP($J,"AGG")
47 K ^TMP($J,"AG"),BDC
48 S B=0,RC=1
49 F S B=$O(^TMP($J,"TT",B)) Q:B'>0 D
50 .S RK=0
51 .F S RK=$O(^TMP($J,"TT",B,RK)) Q:RK'>0 D
52 . .Q:'$D(^RMPO(665.72,"AC",RK))
53 . .S ^TMP($J,"RMPRC",RC)=RK
54 . .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)
55 . .S RC=RC+1
56 S RK=0,RZ=0
57 K ^TMP($J,"TT"),B
58 ;
59 G:'$D(^TMP($J,"RMPRC")) END
60 ;
61DIS ;format data string - only HOME OXYGEN
62 S RC=""
63 S RK=1
64 F S RK=$O(^TMP($J,"RMPRC",RK)) Q:RK="" D
65 .S AN=+^TMP($J,"RMPRC",RK)
66 .S Y=^RMPR(660,AN,0)
67 .D PRT
68 ;
69END ;
70 ;
71EXIT ;common exit point
72 K ^TMP($J,"RMPRC")
73 ;pass to broker
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=$P($G(^RMPR(660,AN,1)),U,4)
96 ;S TYPE=$S(TYPE="":"",$D(^RMPR(661,TYPE,0)):$P(^(0),U,1),1:"")
97 S AMIS=$P(Y,U,15),VEN=$S(VEN="":"",$D(^PRC(440,VEN,0)):$P(^(0),U,1),1:"")
98 I $D(^RMPR(660.1,"AC",AN)),$P(^RMPR(660.1,$O(^RMPR(660.1,"AC",AN,0)),0),U,11)]"" S AMIS=AMIS_"+"
99 S TRANS=$S(TRANS]"":TRANS,1:""),TRANS1="" S:TRANS="X" TRANS1=TRANS,TRANS=""
100 S DEL=$E(DEL,4,5)_"/"_$E(DEL,6,7)_"/"_$E(DEL,2,3) S:DEL="//" DEL=""
101 ;
102 ;set results array
103 ;only home oxygen records at this point
104 S ITEM=$S(TYPE'="":$P($G(^RMPR(661.1,TYPE,0)),U,2),$P(Y,U,26)="D":"DELIVERY",$P(Y,U,26)="P":"PICKUP",$P(Y,U,17):"SHIPPING",1:"")
105 ;
106 S HCPCS=$P($G(^RMPR(660,$P(^TMP($J,"RMPRC",RK),U,1),1)),U,4)
107 I HCPCS'="" S HCPCS=$P($G(^RMPR(661.1,HCPCS,0)),U,1)
108 S ^TMP($J,"RMPRB",RK)=$P(^TMP($J,"RMPRC",RK),U,1)_U_DATE_U_QTY_U_ITEM
109 S ^TMP($J,"RMPRB",RK)=^TMP($J,"RMPRB",RK)_U_HCPCS_U_TRANS_TRANS1
110 ;
111 ;display source of procurement for 2529-3 under vendor header
112 I $D(RMPRLPRO) S ^TMP($J,"RMPRB",RK)=^TMP($J,"RMPRB",RK)_U_RMPRLPRO
113 I '$D(RMPRLPRO),VEN'="" S ^TMP($J,"RMPRB",RK)=^TMP($J,"RMPRB",RK)_U_$E(VEN,1,10)
114 K RMPRLPRO
115 ;
116 S ^TMP($J,"RMPRB",RK)=^TMP($J,"RMPRB",RK)_U_$P($G(^DIC(4,STA,99)),U,1)_U_SN_U_DEL
117 I $P(^TMP($J,"RMPRC",RK),U,3) S CST=$P(^TMP($J,"RMPRC",RK),U,3)
118 S COST=$J($FN($S(CST'="":CST,$P(Y,U,17):$P(Y,U,17),1:""),"T",2),9)
119 ;
120 S ^TMP($J,"RMPRB",RK)=^TMP($J,"RMPRB",RK)_U_COST_U_REM
121 ;
122 I $P(^TMP($J,"RMPRC",RK),U,2)="" S $P(^TMP($J,"RMPRC",RK),U,2)=RZ
123 ;
124 Q
125 ;END
Note: See TracBrowser for help on using the repository browser.