1 | RMPRSE2 ;PHX/RFM/HNB -SEARCH FILE 660 ENTRIES FOR HCPCS HISTORY ;1/23/1998
|
---|
2 | ;;3.0;PROSTHETICS;**28,30,32,36,46,77,90**;Feb 09, 1996
|
---|
3 | ;RVD 3/17/03 patch #77 - allow queing to p-message. IO to ION.
|
---|
4 | ;this routine is modified for future patch
|
---|
5 | EN S (ITEM,RMPRARR,RMPRI)=""
|
---|
6 | K KILL
|
---|
7 | D HOME^%ZIS,DIV4^RMPRSIT G:$D(X) EXIT1
|
---|
8 | W !!!
|
---|
9 | S DIC="^ICPT(",DIC(0)="AEQM"
|
---|
10 | F ITEM=1:1 S DIC("A")="Select HCPCS ("_ITEM_"): " D ^DIC G:$D(DTOUT)!(X["^")!(X=""&(ITEM=1)) EXIT1 Q:X="" D
|
---|
11 | .I $D(RMPRI(+Y)) W !,$C(7)," ??",?40,"..Duplicate HCPCS" S ITEM=ITEM-1 Q
|
---|
12 | .S RMPRARR(ITEM)=+Y,RMPRI(+Y)=""
|
---|
13 | S RMPRCOUN=0 W !! S %DT("A")="Beginning Date: ",%DT="AEPX",%DT("B")="T-30" D ^%DT S RMPRBDT=Y G:Y<0 EXIT1
|
---|
14 | ENDATE S %DT("A")="Ending Date: ",%DT="AEX",%DT("B")="TODAY"
|
---|
15 | D ^%DT G:Y<0 EXIT1
|
---|
16 | I RMPRBDT>Y W !,$C(7),"Invalid Date Range Selection!!" G ENDATE
|
---|
17 | G:Y<0 EXIT
|
---|
18 | S RMPREDT=Y,Y=RMPRBDT D DD^%DT S RMPRX=Y,Y=RMPREDT D DD^%DT S RMPRY=Y
|
---|
19 | S %ZIS="MQ" K IOP D ^%ZIS G:POP EXIT
|
---|
20 | I '$D(IO("Q")) U IO G PRINT
|
---|
21 | K IO("Q") S ZTDESC="SEARCH FOR RECALLED ITEM",ZTRTN="PRINT^RMPRSE2",ZTIO=ION,ZTSAVE("RMPRBDT")="",ZTSAVE("RMPREDT")="",ZTSAVE("RMPRI(")="",ZTSAVE("RMPRX")="",ZTSAVE("RMPRY")="",ZTSAVE("RMPR(""STA"")")="",ZTSAVE("RMPRARR(")=""
|
---|
22 | S ZTSAVE("RMPRSITE")=""
|
---|
23 | D ^%ZTLOAD W:$D(ZTSK) !,"REQUEST QUEUED!" H 1 G EXIT1
|
---|
24 | PRINT ;ENTRY POINT FOR PRINTING REPORT
|
---|
25 | S PAGE=1,(RMPRCOUN,RP,QTYT,COSTT)=0
|
---|
26 | S RQ=0
|
---|
27 | F S RQ=$O(RMPRARR(RQ)) Q:RQ'>0!($D(KILL)) D D REST
|
---|
28 | .S RO=$P(RMPRARR(RQ),U,1),RO=RO-1
|
---|
29 | .F S RO=$O(^RMPR(660,"G",RO)) Q:RO'>0 D
|
---|
30 | . .Q:RO=""!(RO'=$P(RMPRARR(RQ),U))!($D(KILL))
|
---|
31 | . .K ENDD
|
---|
32 | . .F S RP=$O(^RMPR(660,"G",RO,RP)) Q:RP=""!($D(KILL)) D CK
|
---|
33 | G EXIT
|
---|
34 | Q
|
---|
35 | EXIT ;EXIT FROM REPORT HERE
|
---|
36 | I RMPRCOUN>0,$D(RMPREDT),'$D(KILL) W !!?32,"END OF REPORT"
|
---|
37 | I $E(IOST)["C"&($Y<22),'$D(ENDD) F W ! Q:$Y>20
|
---|
38 | I $D(RMPREDT),$E(IOST)["C",'$D(RMPRFLL),'$D(KILL),'$D(DUOUT),'$D(DTOUT),'$D(ENDD) K DIR S DIR(0)="E" D ^DIR
|
---|
39 | EXIT1 K RMPRARR,%DT,GOTO,QTYT,ITEM,KILL,ENDD,RQ,RP,RO,ITEM,RMPRI,COSTT,DIC,DIR,PAGE,RO,RMPRCOUN,RMPRSE,RMPRBDT,RMPREDT,RMPRX,RMPRY D ^%ZISC
|
---|
40 | Q
|
---|
41 | CK Q:'$D(^RMPR(660,RP,0))
|
---|
42 | ;hcpcs
|
---|
43 | I ('$P(^(0),U,22))!($P(^(0),U,3)<RMPRBDT)!($P(^(0),U,3)>RMPREDT) Q
|
---|
44 | I $P(^RMPR(660,RP,0),U,10)'=RMPR("STA") Q
|
---|
45 | ;I '$D(^PRC(441,$P(^RMPR(661,$P(^(0),U,6),0),U))) Q
|
---|
46 | I $P(RMPRARR(RQ),U,1)=$P(^RMPR(660,RP,0),U,22) D CON
|
---|
47 | Q
|
---|
48 | ;
|
---|
49 | CON I $Y>(IOSL-6),PAGE=1,'RMPRCOUN W @IOF
|
---|
50 | D HEAD S RMPRCOUN=RMPRCOUN+1
|
---|
51 | S Y=$P(^RMPR(660,RP,0),U,3) D DD^%DT
|
---|
52 | W !,Y,?15,$E($P(^DPT($P(^RMPR(660,RP,0),U,2),0),U,1),1,13),?30,$E($P(^DPT($P(^RMPR(660,RP,0),U,2),0),U,9),6,9)
|
---|
53 | W:$P(^RMPR(660,RP,0),U,9)'="" ?36,$E($P(^PRC(440,$P(^RMPR(660,RP,0),U,9),0),U,1),1,35)
|
---|
54 | W !,"ITEM: " S ITMP=$P(^RMPR(660,RP,0),U,6)
|
---|
55 | W:ITMP'="" $E($P(^PRC(441,$P(^RMPR(661,ITMP,0),U,1),0),U,2),1,20)
|
---|
56 | K ITMP
|
---|
57 | I $P(^RMPR(660,RP,0),U,13)=4 D
|
---|
58 | .W ?27,"QTY: ",$J($P(^RMPR(660,RP,0),U,7),4),?38,"TOTAL COST: ",$J($FN($P(^("LB"),U,9),"P",2),8) S QTYT=QTYT+$P(^(0),U,7),COSTT=COSTT+$P(^("LB"),U,9)
|
---|
59 | I $P(^RMPR(660,RP,0),U,13)'=4 W ?27,"QTY: ",$J($P(^RMPR(660,RP,0),U,7),4),?38,"TOTAL COST: ",$J($FN($P(^(0),U,16),"P",2),8) S QTYT=QTYT+$P(^(0),U,7),COSTT=COSTT+$P(^(0),U,16)
|
---|
60 | W ?60,$S($P(^RMPR(660,RP,0),U,4)="I":"INITIAL ISSUE",$P(^(0),U,4)="R":"REPLACEMENT",$P(^(0),U,4)="S":"SPARE",$P(^(0),U,4)="X":"REPAIR",$P(^(0),U,4)="5":"RENTAL",1:"UNK"),!,"INITIATOR: "
|
---|
61 | I $P(^RMPR(660,RP,0),U,27),$D(^VA(200,$P(^(0),U,27),0)) W ?15,$P(^(0),U),!
|
---|
62 | I $E(IOST)["C"&($Y>(IOSL-6)) S DIR(0)="E" D ^DIR S:Y<1 KILL=1 Q:Y<1 K DIR W @IOF D HEAD Q
|
---|
63 | I $Y>(IOSL-6) W @IOF D HEAD
|
---|
64 | Q
|
---|
65 | ;
|
---|
66 | HEAD I $Y<2!(PAGE=1) D
|
---|
67 | .W !,"HCPCS HISTORY:",?15
|
---|
68 | .W $E($P(^ICPT($P(^RMPR(660,RP,0),U,22),0),U,1),1,39)
|
---|
69 | .W ?63,"STA ",$$STA^RMPRUTIL,?72,"PAGE ",PAGE S PAGE=PAGE+1
|
---|
70 | .W !!,"REQUEST DATE",?15,"PATIENT NAME",?30,"SSN",?36,"VENDOR"
|
---|
71 | .S Y=RMPRBDT D DD^%DT W ?55,Y,"-" S Y=RMPREDT D DD^%DT W Y
|
---|
72 | .W ! F BH=1:1:IOM W "="
|
---|
73 | Q
|
---|
74 | ;
|
---|
75 | REST D:'RMPRCOUN NONE Q:$D(KILL)!('RMPRCOUN) W !,"TOTAL DOLLARS SPENT ON THIS HCPCS: ","$"_$J($FN(COSTT,"P",2),9),?45,"TOTAL QUANTITY ISSUED: ",$J(QTYT,4)
|
---|
76 | I $O(RMPRARR(RQ)),$E(IOST)["C" W ! K DIR S DIR(0)="E" D ^DIR S:Y<1 KILL=1 W:'$D(KILL) @IOF
|
---|
77 | I $E(IOST)'["C",$O(RMPRARR(RQ)) W @IOF
|
---|
78 | S (COSTT,QTYT,RMPRCOUN)=""
|
---|
79 | Q
|
---|
80 | ;
|
---|
81 | NONE W @IOF,!!,"No '",$P(^ICPT(RMPRARR(RQ),0),U,1),"' HCPCS History for this date range.",!
|
---|
82 | ;,$P(^PRC(441,$P(^RMPR(661,$P(RMPRARR(RQ),U),0),U),0),U,2)
|
---|
83 | I $E(IOST)["C" K DIR S DIR(0)="E" W !!!! D ^DIR W @IOF S:Y<1 KILL=1 S ENDD=1
|
---|
84 | Q
|
---|
85 | XREF ;set new x-ref for the field HCPCS in 660
|
---|
86 | W !!,"New Cross Reference for HCPCS..."
|
---|
87 | S DIK="^RMPR(660,",DIK(1)="4.1^G" D ENALL^DIK
|
---|
88 | Q
|
---|
89 | ;END
|
---|