source: WorldVistAEHR/trunk/r/INTEGRATED_BILLING-IB-PRQ--IBD--IBQ--PRQS/IBTOUR5.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: 2.4 KB
Line 
1IBTOUR5 ;ALB/AAS - CLAIMS TRACKING UR/ACTIVITY REPORT ; 14-FEB-94
2 ;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
3 ;
4% ;
5HSUB ; -- compute subtotals for hospital reviews
6 S IBTRN="" F S IBTRN=$O(^TMP($J,"IBTOUR4",IBTRN)) Q:'IBTRN D HSUB1
7 Q
8 ;
9HSUB1 ; -- compute subtotals for 1 review
10 S (IBDAYS,IBDAYN,IBPREV)=0,IBADM=""
11 S IBCNT(40)=IBCNT(40)+1 ; cases reviewed
12 S IBTRND=$G(^IBT(356,+IBTRN,0)),DGPM=$P(IBTRND,"^",5)
13 I $P(IBTRND,"^",6)<IBBDT S IBPREV=1 S IBCNT(42)=IBCNT(42)+1 ;previous case
14 S IBCLOSE=$$HCLOSE(DGPM,IBTRN)
15 I 'IBPREV,'IBCLOSE S IBCNT(41)=IBCNT(41)+1 ; NEW case still open
16 I IBPREV,'IBCLOSE S IBCNT(43)=IBCNT(43)+1 ; Old case still open
17 I $P(IBTRND,"^",25) S IBCNT(44)=IBCNT(44)+1
18 I $P(IBTRND,"^",26) S IBCNT(45)=IBCNT(45)+1,IBCNT(45,$P(IBTRND,"^",26))=IBCNT(45,$P(IBTRND,"^",26))+1
19 I $P(IBTRND,"^",27) S IBCNT(46)=IBCNT(46)+1 ; local cases
20 S IBTRV="" F S IBTRV=$O(^IBT(356.1,"C",IBTRN,IBTRV)) Q:'IBTRV D
21 .S IBTRVD=$G(^IBT(356.1,+IBTRV,0))
22 .S (IBP1,IBP2,IBP3,IBP4)=0
23 .I $P(IBTRVD,"^",21)'=10 Q ; review must be complete
24 .I +IBTRVD<IBBDT!(+IBTRVD>IBEDT) Q ; review date out of range
25 .S IBSPEC=$P($G(^DIC(45.7,+$P(IBTRVD,"^",7),0)),"^")
26 .S IBCNT(48)=IBCNT(48)+1 ; count of days
27 .I $P(IBTRVD,"^",3)<2 D
28 ..S MET=$O(^IBT(356.1,+IBTRV,12,0)) ; >0 means not met
29 ..I MET S IBCNT(50)=IBCNT(50)+1,IBCNT(51)=IBCNT(51)+1,(IBP2,IBP4)=1,IBADM=0,IBDAYN=IBDAYN+1
30 ..I 'MET S IBCNT(49)=IBCNT(49)+1,IBCNT(47)=IBCNT(47)+1,(IBP1,IBP3)=1,IBADM=1,IBDAYS=IBDAYS+1
31 .I $P(IBTRVD,"^",3)>1 D
32 ..S MET=$O(^IBT(356.1,+IBTRV,13,0))
33 ..I MET S IBCNT(50)=IBCNT(50)+1,IBP4=1,IBDAYN=IBDAYN+1
34 ..I 'MET S IBCNT(49)=IBCNT(49)+1,IBP3=1,IBDAYS=IBDAYS+1
35 .D HSET1^IBTOUR2
36 D HSET2^IBTOUR2
37 Q
38 ;
39HCLOSE(DGPM,IBTRN) ; -- is case closed
40 N IBI,IBJ,IBCLOSE
41 S IBCLOSE=0
42 S IBTRND=$G(^IBT(356,+IBTRN,0))
43 I $P($G(^DGPM(+DGPM,0)),"^",17) S IBCLOSE=1 G HCLOSEQ ; - discharged
44 I '$P(IBTRND,"^",25),'$P(IBTRND,"^",26),'$P(IBTRND,"^",27) S IBCLOSE=1 G HCLOSEQ ; ur no longer required
45 ;
46 ; -- see if any reviews are still pending or if is a discharge date
47 S IBCLOSE=1,IBI=0 F S IBI=$O(^IBT(356.1,"C",IBTRN,IBI)) Q:'IBI D Q:'IBCLOSE
48 .I $P(^IBT(356.1,IBI,0),"^",20)>IBEDT S IBCLOSE=0 Q
49 ;
50HCLOSEQ Q IBCLOSE
51 ;
52SUBHDR ; -- sub header for detailed listings from ibtour4
53 Q:IBHOW="P"
54 W !,?15,$S(IBHOW="S":"Specialty: ",1:"Reviewer: "),IBH
55 Q
56SSUBHDR ; -- sub sub header for detailed listings from ibtour4
57 Q:IBHOW'="R"
58 W !,?18,"Type Review: ",IBI
59 Q
Note: See TracBrowser for help on using the repository browser.