IBTOUR5 ;ALB/AAS - CLAIMS TRACKING UR/ACTIVITY REPORT ; 14-FEB-94
;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
;
% ;
HSUB ; -- compute subtotals for hospital reviews
S IBTRN="" F S IBTRN=$O(^TMP($J,"IBTOUR4",IBTRN)) Q:'IBTRN D HSUB1
Q
;
HSUB1 ; -- compute subtotals for 1 review
S (IBDAYS,IBDAYN,IBPREV)=0,IBADM=""
S IBCNT(40)=IBCNT(40)+1 ; cases reviewed
S IBTRND=$G(^IBT(356,+IBTRN,0)),DGPM=$P(IBTRND,"^",5)
I $P(IBTRND,"^",6)<IBBDT S IBPREV=1 S IBCNT(42)=IBCNT(42)+1 ;previous case
S IBCLOSE=$$HCLOSE(DGPM,IBTRN)
I 'IBPREV,'IBCLOSE S IBCNT(41)=IBCNT(41)+1 ; NEW case still open
I IBPREV,'IBCLOSE S IBCNT(43)=IBCNT(43)+1 ; Old case still open
I $P(IBTRND,"^",25) S IBCNT(44)=IBCNT(44)+1
I $P(IBTRND,"^",26) S IBCNT(45)=IBCNT(45)+1,IBCNT(45,$P(IBTRND,"^",26))=IBCNT(45,$P(IBTRND,"^",26))+1
I $P(IBTRND,"^",27) S IBCNT(46)=IBCNT(46)+1 ; local cases
S IBTRV="" F S IBTRV=$O(^IBT(356.1,"C",IBTRN,IBTRV)) Q:'IBTRV D
.S IBTRVD=$G(^IBT(356.1,+IBTRV,0))
.S (IBP1,IBP2,IBP3,IBP4)=0
.I $P(IBTRVD,"^",21)'=10 Q ; review must be complete
.I +IBTRVD<IBBDT!(+IBTRVD>IBEDT) Q ; review date out of range
.S IBSPEC=$P($G(^DIC(45.7,+$P(IBTRVD,"^",7),0)),"^")
.S IBCNT(48)=IBCNT(48)+1 ; count of days
.I $P(IBTRVD,"^",3)<2 D
..S MET=$O(^IBT(356.1,+IBTRV,12,0)) ; >0 means not met
..I MET S IBCNT(50)=IBCNT(50)+1,IBCNT(51)=IBCNT(51)+1,(IBP2,IBP4)=1,IBADM=0,IBDAYN=IBDAYN+1
..I 'MET S IBCNT(49)=IBCNT(49)+1,IBCNT(47)=IBCNT(47)+1,(IBP1,IBP3)=1,IBADM=1,IBDAYS=IBDAYS+1
.I $P(IBTRVD,"^",3)>1 D
..S MET=$O(^IBT(356.1,+IBTRV,13,0))
..I MET S IBCNT(50)=IBCNT(50)+1,IBP4=1,IBDAYN=IBDAYN+1
..I 'MET S IBCNT(49)=IBCNT(49)+1,IBP3=1,IBDAYS=IBDAYS+1
.D HSET1^IBTOUR2
D HSET2^IBTOUR2
Q
;
HCLOSE(DGPM,IBTRN) ; -- is case closed
N IBI,IBJ,IBCLOSE
S IBCLOSE=0
S IBTRND=$G(^IBT(356,+IBTRN,0))
I $P($G(^DGPM(+DGPM,0)),"^",17) S IBCLOSE=1 G HCLOSEQ ; - discharged
I '$P(IBTRND,"^",25),'$P(IBTRND,"^",26),'$P(IBTRND,"^",27) S IBCLOSE=1 G HCLOSEQ ; ur no longer required
;
; -- see if any reviews are still pending or if is a discharge date
S IBCLOSE=1,IBI=0 F S IBI=$O(^IBT(356.1,"C",IBTRN,IBI)) Q:'IBI D Q:'IBCLOSE
.I $P(^IBT(356.1,IBI,0),"^",20)>IBEDT S IBCLOSE=0 Q
;
HCLOSEQ Q IBCLOSE
;
SUBHDR ; -- sub header for detailed listings from ibtour4
Q:IBHOW="P"
W !,?15,$S(IBHOW="S":"Specialty: ",1:"Reviewer: "),IBH
Q
SSUBHDR ; -- sub sub header for detailed listings from ibtour4
Q:IBHOW'="R"
W !,?18,"Type Review: ",IBI
Q
IBTOUR5 ;ALB/AAS - CLAIMS TRACKING UR/ACTIVITY REPORT ; 14-FEB-94
+1 ;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
+2 ;
% ;
HSUB ; -- compute subtotals for hospital reviews
+1 SET IBTRN=""
FOR
SET IBTRN=$ORDER(^TMP($JOB,"IBTOUR4",IBTRN))
IF 'IBTRN
QUIT
DO HSUB1
+2 QUIT
+3 ;
HSUB1 ; -- compute subtotals for 1 review
+1 SET (IBDAYS,IBDAYN,IBPREV)=0
SET IBADM=""
+2 ; cases reviewed
SET IBCNT(40)=IBCNT(40)+1
+3 SET IBTRND=$GET(^IBT(356,+IBTRN,0))
SET DGPM=$PIECE(IBTRND,"^",5)
+4 ;previous case
IF $PIECE(IBTRND,"^",6)<IBBDT
SET IBPREV=1
SET IBCNT(42)=IBCNT(42)+1
+5 SET IBCLOSE=$$HCLOSE(DGPM,IBTRN)
+6 ; NEW case still open
IF 'IBPREV
IF 'IBCLOSE
SET IBCNT(41)=IBCNT(41)+1
+7 ; Old case still open
IF IBPREV
IF 'IBCLOSE
SET IBCNT(43)=IBCNT(43)+1
+8 IF $PIECE(IBTRND,"^",25)
SET IBCNT(44)=IBCNT(44)+1
+9 IF $PIECE(IBTRND,"^",26)
SET IBCNT(45)=IBCNT(45)+1
SET IBCNT(45,$PIECE(IBTRND,"^",26))=IBCNT(45,$PIECE(IBTRND,"^",26))+1
+10 ; local cases
IF $PIECE(IBTRND,"^",27)
SET IBCNT(46)=IBCNT(46)+1
+11 SET IBTRV=""
FOR
SET IBTRV=$ORDER(^IBT(356.1,"C",IBTRN,IBTRV))
IF 'IBTRV
QUIT
Begin DoDot:1
+12 SET IBTRVD=$GET(^IBT(356.1,+IBTRV,0))
+13 SET (IBP1,IBP2,IBP3,IBP4)=0
+14 ; review must be complete
IF $PIECE(IBTRVD,"^",21)'=10
QUIT
+15 ; review date out of range
IF +IBTRVD<IBBDT!(+IBTRVD>IBEDT)
QUIT
+16 SET IBSPEC=$PIECE($GET(^DIC(45.7,+$PIECE(IBTRVD,"^",7),0)),"^")
+17 ; count of days
SET IBCNT(48)=IBCNT(48)+1
+18 IF $PIECE(IBTRVD,"^",3)<2
Begin DoDot:2
+19 ; >0 means not met
SET MET=$ORDER(^IBT(356.1,+IBTRV,12,0))
+20 IF MET
SET IBCNT(50)=IBCNT(50)+1
SET IBCNT(51)=IBCNT(51)+1
SET (IBP2,IBP4)=1
SET IBADM=0
SET IBDAYN=IBDAYN+1
+21 IF 'MET
SET IBCNT(49)=IBCNT(49)+1
SET IBCNT(47)=IBCNT(47)+1
SET (IBP1,IBP3)=1
SET IBADM=1
SET IBDAYS=IBDAYS+1
End DoDot:2
+22 IF $PIECE(IBTRVD,"^",3)>1
Begin DoDot:2
+23 SET MET=$ORDER(^IBT(356.1,+IBTRV,13,0))
+24 IF MET
SET IBCNT(50)=IBCNT(50)+1
SET IBP4=1
SET IBDAYN=IBDAYN+1
+25 IF 'MET
SET IBCNT(49)=IBCNT(49)+1
SET IBP3=1
SET IBDAYS=IBDAYS+1
End DoDot:2
+26 DO HSET1^IBTOUR2
End DoDot:1
+27 DO HSET2^IBTOUR2
+28 QUIT
+29 ;
HCLOSE(DGPM,IBTRN) ; -- is case closed
+1 NEW IBI,IBJ,IBCLOSE
+2 SET IBCLOSE=0
+3 SET IBTRND=$GET(^IBT(356,+IBTRN,0))
+4 ; - discharged
IF $PIECE($GET(^DGPM(+DGPM,0)),"^",17)
SET IBCLOSE=1
GOTO HCLOSEQ
+5 ; ur no longer required
IF '$PIECE(IBTRND,"^",25)
IF '$PIECE(IBTRND,"^",26)
IF '$PIECE(IBTRND,"^",27)
SET IBCLOSE=1
GOTO HCLOSEQ
+6 ;
+7 ; -- see if any reviews are still pending or if is a discharge date
+8 SET IBCLOSE=1
SET IBI=0
FOR
SET IBI=$ORDER(^IBT(356.1,"C",IBTRN,IBI))
IF 'IBI
QUIT
Begin DoDot:1
+9 IF $PIECE(^IBT(356.1,IBI,0),"^",20)>IBEDT
SET IBCLOSE=0
QUIT
End DoDot:1
IF 'IBCLOSE
QUIT
+10 ;
HCLOSEQ QUIT IBCLOSE
+1 ;
SUBHDR ; -- sub header for detailed listings from ibtour4
+1 IF IBHOW="P"
QUIT
+2 WRITE !,?15,$SELECT(IBHOW="S":"Specialty: ",1:"Reviewer: "),IBH
+3 QUIT
SSUBHDR ; -- sub sub header for detailed listings from ibtour4
+1 IF IBHOW'="R"
QUIT
+2 WRITE !,?18,"Type Review: ",IBI
+3 QUIT