1 | RMPRN6XM ;Hines OIFO/HNC - NPPD Auto-Fix ;9/16/02 11:14
|
---|
2 | ;;3.0;PROSTHETICS;**70,90**;Feb 09, 1996
|
---|
3 | Q
|
---|
4 | TASK ;main entry point
|
---|
5 | ;look at file 660, field #2 Type.
|
---|
6 | ;this will need to be updated with 1=new and 2=repair.
|
---|
7 | ;
|
---|
8 | ;"I" = initial issue = new
|
---|
9 | ;"R" = replace = new
|
---|
10 | ;"S" = spare = new
|
---|
11 | ;"X" = repair = repair
|
---|
12 | ; 5 = rental = repair added with patch 90
|
---|
13 | ;
|
---|
14 | K ^TMP($J)
|
---|
15 | S B=0,LINE=""
|
---|
16 | F S B=$O(^RMPR(660,B)) Q:B'>0 D
|
---|
17 | .S TYPE=$P($G(^RMPR(660,B,0)),U,4)
|
---|
18 | .I TYPE=5 Q ;No change if Rental just quit.
|
---|
19 | .;if type is null, then Home Oxygen Posted with no type, and that is
|
---|
20 | .;a repair NPPD line. Or, shipping and that is repair.
|
---|
21 | .I TYPE="" S TYPE="X"
|
---|
22 | .S PHCPCS=$P($G(^RMPR(660,B,1)),U,4)
|
---|
23 | .;junk in the global - alpha
|
---|
24 | .Q:PHCPCS'>0
|
---|
25 | .Q:PHCPCS=""
|
---|
26 | .I TYPE'="X" S LINE=$P(^RMPR(661.1,PHCPCS,0),U,7)
|
---|
27 | .I LINE="" D
|
---|
28 | . .S ERR=""
|
---|
29 | . .S LINE=$P(^RMPR(661.1,PHCPCS,0),U,6)
|
---|
30 | . .S TYPE="X"
|
---|
31 | . .S DIE="^RMPR(660,",DA=B,DR="2///^S X=TYPE"
|
---|
32 | . .L +^RMPR(660,B):1 I '$T S ERR=1
|
---|
33 | . .W !,B," ",ERR
|
---|
34 | . .I ERR=1 S ^TMP($J,"RMPRA",B)="NO UPDATE!"
|
---|
35 | . .I ERR="" D ^DIE L -^RMPR(660,B)
|
---|
36 | . .K DIE,DA,DR
|
---|
37 | . .I ERR="" S ^TMP($J,"RMPRA",B)="NEW TO REPAIR"
|
---|
38 | . .D DATA
|
---|
39 | .I TYPE="X" S LINE=$P(^RMPR(661.1,PHCPCS,0),U,6)
|
---|
40 | .I LINE="" D
|
---|
41 | . .S ERR=""
|
---|
42 | . .S LINE=$P(^RMPR(661.1,PHCPCS,0),U,7)
|
---|
43 | . .S TYPE="I"
|
---|
44 | . .S DIE="^RMPR(660,",DA=B,DR="2///^S X=TYPE"
|
---|
45 | . .L +^RMPR(660,B):1 I '$T S ERR=1
|
---|
46 | . .I ERR=1 S ^TMP($J,"RMPRA",B)="NO UPDATE!"
|
---|
47 | . .I ERR="" D ^DIE L -^RMPR(660,B)
|
---|
48 | . .K DIE,DA,DR
|
---|
49 | . .I ERR="" S ^TMP($J,"RMPRA",B)="REPAIR TO NEW "
|
---|
50 | . .D DATA
|
---|
51 | K B,LINE,PHCPCS,TYPE
|
---|
52 | D FMT
|
---|
53 | I $D(^TMP($J,"RMPR")) D MAIL
|
---|
54 | G EXIT
|
---|
55 | Q
|
---|
56 | DATA ;delimited tmp with data
|
---|
57 | D GETS^DIQ(660,B,".01;.02;4.5;5;7;8.3;14;4;24;27","","RMXM")
|
---|
58 | S $P(^TMP($J,"RMPRA",B),U,2)=$G(RMXM(660,B_",",.01))
|
---|
59 | S $P(^TMP($J,"RMPRA",B),U,3)=$G(RMXM(660,B_",",.02))
|
---|
60 | S $P(^TMP($J,"RMPRA",B),U,4)=$G(RMXM(660,B_",",4.5))
|
---|
61 | S $P(^TMP($J,"RMPRA",B),U,5)=$G(RMXM(660,B_",",5))
|
---|
62 | S $P(^TMP($J,"RMPRA",B),U,6)=$G(RMXM(660,B_",",7))
|
---|
63 | S $P(^TMP($J,"RMPRA",B),U,7)=$G(RMXM(660,B_",",8.3))
|
---|
64 | S $P(^TMP($J,"RMPRA",B),U,8)=$G(RMXM(660,B_",",14))
|
---|
65 | S $P(^TMP($J,"RMPRA",B),U,9)=$G(RMXM(660,B_",",4))
|
---|
66 | S $P(^TMP($J,"RMPRA",B),U,10)=$G(RMXM(660,B_",",27))
|
---|
67 | S $P(^TMP($J,"RMPRA",B),U,11)=LINE
|
---|
68 | S $P(^TMP($J,"RMPRA",B),U,12)=$G(RMXM(660,B_",",24))
|
---|
69 | K RMXM
|
---|
70 | Q
|
---|
71 | FMT ;format the records for report display
|
---|
72 | S B=0,^TMP($J,"RMPRFMT")="",CNT=0
|
---|
73 | F S B=$O(^TMP($J,"RMPRA",B)) Q:B'>0 D
|
---|
74 | .S DATA=^TMP($J,"RMPRA",B)
|
---|
75 | .S (B1,BX,B3,B4,B5,B6,B7,B8)=""
|
---|
76 | .S B2="^TMP($J,""RMPRFMT"")"
|
---|
77 | .S B1=$$SETSTR^VALM1($P(DATA,U,1),@B2,1,14)
|
---|
78 | .S BX=$$SETSTR^VALM1($P(DATA,U,2),@B2,1,14)
|
---|
79 | .S B3=$$SETSTR^VALM1($P(DATA,U,3),@B2,1,11)
|
---|
80 | .S B4=$$SETSTR^VALM1($P(DATA,U,4),@B2,1,6)
|
---|
81 | .S B5=$$SETSTR^VALM1($P(DATA,U,9),@B2,1,10)
|
---|
82 | .S B6=$$SETSTR^VALM1($P(DATA,U,6),@B2,2,11)
|
---|
83 | .S B7=$$SETSTR^VALM1($P(DATA,U,10),@B2,2,12)
|
---|
84 | .S OLDLN=$P(DATA,U,1)
|
---|
85 | .I OLDLN["REPAIR TO NEW" S OLDLN="R99 X"
|
---|
86 | .I OLDLN["NEW TO REPAIR" S OLDLN="999 X"
|
---|
87 | .I OLDLN["NO UPDATE!" S OLDLN="????"
|
---|
88 | .;
|
---|
89 | .S CNT=CNT+1
|
---|
90 | .S ^TMP($J,"RMPR",CNT)=B1
|
---|
91 | .S CNT=CNT+1
|
---|
92 | .S ^TMP($J,"RMPR",CNT)="Create Date Patient HCPCS Item Vendor PA"
|
---|
93 | .S CNT=CNT+1
|
---|
94 | .S ^TMP($J,"RMPR",CNT)=BX_B3_B4_B8_B5_B6_B7
|
---|
95 | .S CNT=CNT+1
|
---|
96 | .S ^TMP($J,"RMPR",CNT)=""
|
---|
97 | .S CNT=CNT+1
|
---|
98 | .S ^TMP($J,"RMPR",CNT)="Brief Description: "_$P(DATA,U,12)
|
---|
99 | .S CNT=CNT+1
|
---|
100 | .S ^TMP($J,"RMPR",CNT)=""
|
---|
101 | .S CNT=CNT+1
|
---|
102 | .I OLDLN'="????" S ^TMP($J,"RMPR",CNT)="Changed From Line "_OLDLN_" To NPPD Line: "_$P(DATA,U,11)_" Local Record #:"_B
|
---|
103 | .I OLDLN="????" S ^TMP($J,"RMPR",CNT)="Nothing Changed, Someone Was Editing Record. Local Record #:"_B
|
---|
104 | .S CNT=CNT+1
|
---|
105 | .S ^TMP($J,"RMPR",CNT)="-------------------------------------------------------------------------------"
|
---|
106 | Q
|
---|
107 | ;
|
---|
108 | MAIL ;send report via message to mail group RMPR INVENTORY
|
---|
109 | ;
|
---|
110 | S XMY("G.RMPR INVENTORY")=""
|
---|
111 | S XMDUZ=.5
|
---|
112 | S XMTEXT="^TMP($J,""RMPR"","
|
---|
113 | S XMSUB="Prosthetics Auto-Fix"
|
---|
114 | D ^XMD
|
---|
115 | Q
|
---|
116 | ;
|
---|
117 | EXIT ;common exit point
|
---|
118 | K ^TMP($J,"RMPRA"),^TMP($J,"RMPR")
|
---|
119 | Q
|
---|
120 | ;END
|
---|