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

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

initial load of WorldVistAEHR

File size: 4.6 KB
Line 
1IBTRC ;ALB/AAS - CLAIMS TRACKING INSURANCE REVIEWS ; 27-JUN-1993
2 ;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5% ;
6EN ; -- main entry point for IBT COMMUNICATIONS EDITOR from menu's
7 I '$D(DT) D DT^DICRW
8 K XQORS,VALMEVL,IBTRN,IBTRND,IBCNT,DFN,IBTRC,IBTRV,IBTRD,IBCNS,IBCDFN,IBFASTXT,VALMQUIT,VA,VAIN,VAERR
9 ;I '$D(IBTRN) D EN^IBTRE Q
10 D PAT^IBCNSM I $D(VALMQUIT) G ENQ
11 D TRAC^IBTRV I $D(VALMQUIT) G ENQ
12 I '$G(IBTRPRF) S IBTRPRF="12"
13 D EN^VALM("IBT COMMUNICATIONS EDITOR")
14ENQ K XQORS,VALMEVL,IBTRN,IBTRND,IBCNT,DFN,IBTRC,IBTRV,IBTRD,IBCNS,IBCDFN,IBFASTXT,VALMQUIT,IBTRPRF,VA,VAIN,VAERR,X,Y,I,J,IBETYP
15 K IBAMT,IBAPR,IBADG,IBDA,IBDGCR,IBDGCRU1,IBDV,IBETYP,IBETYPD,IBI,IBICD,IBLCNT,IBSEL,IBT,IBTEXT,IBTNOD,IBTSAV,VAUTD
16 K IBAPEAL,IBCDFN,IBCNT,IBDEN,IBDENIAL,IBDENIAL,IBPARNT,IBPEN,IBPENAL,IBTCOD,IBTRDD,IBTRSV,IBTYPE,VAINDT,VA,VALMBCK,OFFSET,I1,I3,IBNEW,IBDENT,IBOE,Z1,T,SDCNT
17 D KVAR^VADPT
18 Q
19 ;
20HDR ; -- header code
21 D PID^VADPT
22 S VALMHDR(1)="Insurance Review Entries for: "_$$PT^IBTUTL1(DFN)_" ROI: "_$$EXPAND^IBTRE(356,.31,$P(^IBT(356,IBTRN,0),"^",31))
23 S VALMHDR(2)=" for: "_$$EXPAND^IBTRE(356,.18,$P(IBTRND,"^",18))_" on "_$$DAT1^IBOUTL($P(IBTRND,"^",6),"2P")
24 Q
25 ;
26INIT ; -- init variables and list array
27 S U="^",VALMCNT=0,VALMBG=1
28 K ^TMP("IBTRC",$J),^TMP("IBTRCDX",$J)
29 K I,X,XQORNOD,DA,DR,DIE,DNM,DQ
30 S IBTRND=$G(^IBT(356,IBTRN,0))
31 D BLD
32 Q
33 ;
34BLD ; -- Build list of Insurnace contacts
35 K ^TMP("IBTRC",$J),^TMP("IBTRCDX",$J)
36 N IBI,J,IBTRC,IBTRCD,IBTRCD1
37 S VALMSG=$$MSG^IBTUTL3(DFN)
38 S (IBTRC,IBCNT,VALMCNT)=0,IBI=""
39 F S IBI=$O(^IBT(356.2,"ATIDT",IBTRN,IBI)) Q:'IBI S IBTRC=0 F S IBTRC=$O(^IBT(356.2,"ATIDT",IBTRN,IBI,IBTRC)) Q:'IBTRC D
40 .S IBTRCD=$G(^IBT(356.2,+IBTRC,0))
41 .S IBTRCD1=$G(^IBT(356.2,+IBTRC,1))
42 .Q:'+$P(IBTRCD,"^",19) ;quit if inactive
43 .S IBCNT=IBCNT+1
44 .S IBETYP=$G(^IBE(356.11,+$P(IBTRCD,"^",4),0))
45 .W "."
46 .S X=""
47 .S X=$$SETFLD^VALM1(IBCNT,X,"NUMBER")
48 .S X=$$SETFLD^VALM1($P($$DAT1^IBOUTL(+IBTRCD,"2P")," "),X,"DATE")
49 .S X=$$SETFLD^VALM1($P($G(^DIC(36,+$P(IBTRCD,"^",8),0)),"^"),X,"INS CO")
50 .S X=$$SETFLD^VALM1($$EXPAND^IBTRE(356.2,.11,$P(IBTRCD,"^",11)),X,"ACTION")
51 .;
52 .S X=$$SETFLD^VALM1($P(IBETYP,"^",3),X,"TYPE")
53 .S X=$$SETFLD^VALM1($P(IBTRCD,"^",28),X,"PRE-CERT")
54 .I $P(IBTRCD,"^",13) S X=$$SETFLD^VALM1($J($$DAY^IBTUTL3($P(IBTRCD,"^",12),$P(IBTRCD,"^",13),IBTRN),3),X,"DAYS")
55 .I $P($G(^IBE(356.7,+$P(IBTRCD,"^",11),0)),"^",3)=20 S X=$$SETFLD^VALM1($J($$DAY^IBTUTL3($P(IBTRCD,"^",15),$P(IBTRCD,"^",16),IBTRN),3),X,"DAYS")
56 .I $P(IBTRCD1,"^",7)!($P(IBTRCD1,"^",8)) S X=$$SETFLD^VALM1("ALL",X,"DAYS")
57 .S X=$$SETFLD^VALM1($P(IBTRCD,"^",6),X,"CONTACT")
58 .S X=$$SETFLD^VALM1($P(IBTRCD,"^",7),X,"PHONE")
59 .S X=$$SETFLD^VALM1($P(IBTRCD,"^",9),X,"REF NO")
60 .I $P(IBETYP,"^",2)=60!($P(IBETYP,"^",2)=65) D APPEAL^IBTRC3
61 .D SET(X)
62 Q
63 ;
64SET(X) ; -- set arrays
65 S VALMCNT=VALMCNT+1
66 S ^TMP("IBTRC",$J,VALMCNT,0)=X
67 S ^TMP("IBTRC",$J,"IDX",VALMCNT,IBCNT)=""
68 S ^TMP("IBTRCDX",$J,IBCNT)=VALMCNT_"^"_IBTRC
69 Q
70HELP ; -- help code
71 S X="?" D DISP^XQORM1 W !!
72 Q
73 ;
74EXIT ; -- exit code
75 K ^TMP("IBTRC",$J),^TMP("IBTRCDX",$J)
76 K IBTRC
77 D CLEAN^VALM10
78 Q
79 ;
80TYPE(IBTRC) ; -- compute default type of contact
81 N TYPE,IBTRTP,IBTRN,IBSCHED
82 S TYPE=""
83 I '$P($G(^IBT(356.2,IBTRC,0)),"^",2) S TYPE=70 G TYPEQ ;no tracking id default is patient
84 S IBTRN=$P($G(^IBT(356.2,IBTRC,0)),"^",2),IBTRTP=$$TRTP^IBTRE1(IBTRN)
85 ;
86 ; -- if from a review
87 I $G(IBTRV) S TYPE=$$TRTP^IBTRV(IBTRV) G TYPEQ ; if from review use review type
88 I IBTRTP>1 S TYPE=50 G TYPEQ ; outpatient
89 S IBSCHED=$S($P($G(^DGPM(+$P($G(^IBT(356,IBTRN,0)),U,5),0)),U,25):10,1:20)
90 I '$O(^IBT(356.2,"ATRTP",IBTRN,0)) S TYPE=IBSCHED G TYPEQ ; default for first is urgent admission
91 S TYPE=30 ; default is continued stay
92 ;
93TYPEQ Q $P($G(^IBE(356.11,+$O(^IBE(356.11,"ACODE",+TYPE,0)),0)),"^")
94 ;
95TCODE(IBTRC) ; -- return type code for entry
96 Q $P($G(^IBE(356.11,+$P($G(^IBT(356.2,+$G(IBTRC),0)),"^",4),0)),"^",2)
97 ;
98CONTCT(DA,Y) ; -- screen for type of contact
99 ; -- called by dic(s) on lookup of type of contact field in 356.2
100 ;
101 ;"I ($P(^(0),U,2)>60&('$P(^IBT(356.2,DA,0),U,2)))!($P(^(0),U,2))"
102 N IBOK,TCODE S IBOK=1
103 S TCODE=$P(^(0),U,2)
104 I TCODE=85 S IBOK=0 G CONTQ ;insurance verification from ins menu only
105 I TCODE=15 S IBOK=0 G CONTQ ;Admission review only for hosp reviews
106 I '$P($G(^IBT(356.2,DA,0)),U,2),TCODE<70 S IBOK=0 G CONTQ ;no tracking id, only patient or other
107 I TCODE=60,'$P($G(^IBT(356.2,DA,0)),U,18) S IBOK=0 G CONTQ ;appeals must have an associated parent denial
108 S IBTRTP=$$TRTP^IBTRE1($P($G(^IBT(356.2,DA,0)),U,2))
109 I IBTRTP>1,TCODE<50 S IBOK=0 ; not inpatient care, not inpt codes
110CONTQ Q IBOK
Note: See TracBrowser for help on using the repository browser.