source: WorldVistAEHR/trunk/r/INTEGRATED_BILLING-IB-PRQ--IBD--IBQ--PRQS/IBCSC5.m@ 1006

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

revised back to 6/30/08 version

File size: 3.9 KB
Line 
1IBCSC5 ;ALB/MJB - MCCR SCREEN 5 (OPT. EOC) ;27 MAY 88 10:15
2 ;;2.0;INTEGRATED BILLING;**52,125,51,210,266,288,287,309**;21-MAR-94
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5 ;MAP TO DGCRSC5
6 ;
7EN I $$INPAT^IBCEF(IBIFN) G ^IBCSC4
8 I $D(IBASKCOD) K IBASKCOD D CODMUL^IBCU7 I $$BILLCPT^IBCRU4(IBIFN) D ASK^IBCU7A(IBIFN) S DGRVRCAL=1
9 I $D(DGRVRCAL) D ^IBCU6 K DGRVRCAL
10 L ^DGCR(399,IBIFN):1
11 D ^IBCSCU S IBSR=5,IBSR1="",IBV1="10000000"_$S($$FT^IBCEF(IBIFN)'=2:0,1:1) F I="U",0 S IB(I)=$S($D(^DGCR(399,IBIFN,I)):^(I),1:"") S:IBV IBV1="111111111"
12 D H^IBCSCU
13 S IBPTF=$P(IB(0),U,8),IBBT=$P(IB(0),"^",4)_$P(IB(0),"^",5)_$P(IB(0),"^",6)
14 D EN4^IBCVA1
15 S Z=1,IBW=1 X IBWW W " Event Date : " S Y=$P(IB(0),U,3) D DT^DIQ
16 N IBPOARR,IBDATE
17 D SET^IBCSC4D(IBIFN,"",.IBPOARR)
18 S IBDATE=$$BDATE^IBACSV(IBIFN) ; Event date
19 S Z=2,IBW=1 X IBWW W " Prin. Diag.: " S Y=$$DX^IBCSC4(0,IBDATE) W $S(Y'="":$P(Y,U,4)_" - "_$P(Y,U,2),$$DXREQ^IBCSC4(IBIFN):IBU,1:IBUN)
20 F I=1:1:4 S Y=$$DX^IBCSC4(+Y,IBDATE) Q:Y="" W !?4,"Other Diag.: ",$P(Y,U,4)_" - "_$P(Y,U,2)
21 I +Y S Y=$$DX^IBCSC4(+Y,IBDATE) I +Y W !?4,"***There are more diagnoses associated with this bill.***"
22OP S Z=3,IBW=1 X IBWW W " OP Visits : " F I=0:0 S I=$O(^DGCR(399,IBIFN,"OP",I)) Q:'I S Y=I X ^DD("DD") W:$X>67 !?17 W Y_", "
23 S:$D(^DGCR(399,"OP")) DGOPV=1 I '$O(^DGCR(399,IBIFN,"OP",0)) W IBU
24 S Z=4,IBW=1 X IBWW W " Cod. Method: ",$S($P(IB(0),U,9)="":IBUN,$P(IB(0),U,9)=9:"ICD-9-CM",$P(IB(0),U,9)=4:"CPT-4",1:"HCPCS")
25 D WRT:$D(IBPROC)
26 S Z=5,IBW=1 X IBWW W " Rx. Refills: " S Y=$$RX I 'Y W IBUN
27OCC G OCC^IBCSC4
28 W !?4,"Opt. Code : ",IBUN
29 G OCC^IBCSC4
30 Q
31MORE W !?4,*7,"***There are more procedures associated with this bill.***" S I=0
32 Q
33WRT ; -write out procedures codes on screen
34 N IBDATE
35 S J=0 F I=1:1 S J=$O(IBPROC(J)) Q:'J D I I>6 D MORE Q
36 .S IBDATE=$P(IBPROC(J),U,2) I 'IBDATE S IBDATE=$$BDATE^IBACSV($G(IBIFN))
37 .S X=$$PRCD^IBCEF1($P(IBPROC(J),U),1,IBDATE)
38 .I IBPROC(J)["ICD" W !?4,"ICD Code : ",$E($P(X,U,3),1,28)_" - "_$P(X,U,2)
39 .I IBPROC(J)["CPT" W !?4,"CPT Code : " D
40 .. N Z
41 .. S Z=$P(X,"^",3)_" "_$P(X,"^",2)_$S($P(IBPROC(J),U,15):"-"_$$MODLST^IBEFUNC2($P(IBPROC(J),U,15)),1:"")
42 .. I $L(Z)>40 S Z=" "_$P(X,"^",2)_$S($P(IBPROC(J),U,15):"-"_$$MODLST^IBEFUNC2($P(IBPROC(J),U,15)),1:""),Z=$E($P(X,U,3),1,40-$L(Z))_Z
43 .. W Z
44 .I $P(IB(0),U,19)=2 S Y=+$P(IBPROC(J),U,11) S:+Y Y=+$G(^IBA(362.3,+Y,0)) W ?58,$P($$ICD9^IBACSV(Y,IBDATE),U) S Y=$P(IBPROC(J),U,2) D D^DIQ W ?67,Y Q
45 .S Y=$P(IBPROC(J),"^",2) D D^DIQ W ?67,Y
46 Q
47 ;
48MOD(IBM,PUNC) ; Returns modifier list from comma delimited ien's in string IBM
49 ; PUNC = Punctuation to use as first character of output
50 N IBMOD,Q
51 S IBMOD=""
52 F Q=1:1:$L(IBM,",") I $P(IBM,",",Q)'="" S IBMOD=IBMOD_$S(IBMOD'="":",",1:"")_$P($$MOD^ICPTMOD($P(IBM,",",Q),"I"),U,2)
53 I IBMOD'="" S IBMOD=$G(PUNC)_IBMOD
54 Q IBMOD
55 ;
56PD() ;prints prosthetic device in external form, returns 0 if there are none
57 N IBX,IBY,IBZ,IBN,X S X=0 S IBX=0 F S IBX=$O(^IBA(362.5,"AIFN"_IBIFN,IBX)) Q:'IBX D Q:X>5
58 . S IBY=0 F S IBY=$O(^IBA(362.5,"AIFN"_IBIFN,IBX,IBY)) Q:'IBY S IBZ=$G(^IBA(362.5,IBY,0)) I IBZ'="" D Q:X>5
59 .. S X=X+1 I X>5 W !,?17,"*** There are more Pros. Items associated with this bill.***" Q
60 .. ;S IBN=$G(^RMPR(661,+$P(IBZ,U,3),0)) W:X'=1 ! W ?17,$E($$PIN^IBCSC5B(+IBN),1,35)," - ",$P(IBN,U,1),?65,$$FMTE^XLFDT(+IBZ)
61 .. S IBN=$$PIN^IBCSC5B(+$P(IBZ,U,3)) W:X'=1 ! W ?17,$E($P(IBN,U,2),1,35)," - ",$P(IBN,U,1),?65,$$FMTE^XLFDT(+IBZ)
62 Q X
63 ;
64RX() ;prints RX REFILLS in external form, returns 0 if there are none
65 N IBX,IBY,IBZ,IBN,X S X=0 S IBX="" F S IBX=$O(^IBA(362.4,"AIFN"_IBIFN,IBX)) Q:IBX="" D Q:X>5
66 . S IBY=0 F S IBY=$O(^IBA(362.4,"AIFN"_IBIFN,IBX,IBY)) Q:'IBY S IBZ=$G(^IBA(362.4,IBY,0)) I IBZ'="" D Q:X>5
67 .. S X=X+1 I X>5 W !,?17,"*** There are more Rx. Refills associated with this bill.***" Q
68 ..D ZERO^IBRXUTL(+$P(IBZ,U,4))
69 .. S IBN=$G(^TMP($J,"IBDRUG",+$P(IBZ,U,4),.01)) W:X'=1 ! W ?17,IBN,?65,$$FMTE^XLFDT(+$P(IBZ,U,3))
70 K ^TMP($J,"IBDRUG")
71 Q X
72 ;
73 ;IBCSC5
Note: See TracBrowser for help on using the repository browser.