IBTRKR41 ;ALB/AAS - CLAIMS TRACKING - ADD/TRACK OUTPATIENT ENCOUNTERS ; 13-AUG-93
;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
;;Per VHA Directive 10-93-142, this routine should not be modified.
;
OPCHK ; -- check and add rx
S IBCNT=IBCNT+1
K IBRMARK
I '$D(ZTQUEUED),($G(IBTALK)) W "."
;
S IBOEDATA=$G(^SCE(IBOE,0)),IBOESTAT=$P(IBOEDATA,"^",15)
S DFN=$P(IBOEDATA,"^",2)
I 'DFN G OPCHKQ
I $P(IBOEDATA,"^",5) S IBVSIT=$P(IBOEDATA,"^",5)
;
; -- not already in claims tracking
I $O(^IBT(356,"AENC",+DFN,+IBOE,0)) G OPCHKQ ; already in claims tracking
I $O(^IBT(356,"APTY",DFN,IBOETYP,IBDT,0)) G OPCHKQ ; already visit for same date time
;
; -- see if tracking only insured and pt is insured
I $P(IBTRKR,"^",4)=1,'$$INSURED^IBCNS1(DFN,IBDT) G OPCHKQ ; patient not insure
;
; -- check visit status (checked in/out, inpatient, canceled, etc)
I '$P(IBOEDATA,"^",7) G OPCHKQ ; check out not complete
I $P($G(^DPT(DFN,"S",IBDT,0)),"^",2)'="" G OPCHKQ ;is canceled or inpatient or something
;
; -- see if appointment type is billable
I '$$RPT^IBEFUNC($P(IBOEDATA,"^",10),+IBOEDATA) S IBRMARK="NON-BILLABLE APPOINTMENT TYPE"
;
; -- is it a primary visit
I $P(IBOEDATA,"^",6),$P(IBOEDATA,"^",6)'=IBOE G OPCHKQ ; only store primary visits for now
; -- get visit status
I $P(IBOEDATA,"^",12)'=2 G OPCHKQ ;only checked out encounters can be added
;
; -- check sc status, special conditions etc.
I $G(IBRMARK)="" S IBENCL=$$ENCL^IBAMTS2(IBOE) I IBENCL["1" D ; return 1 in string if true "ao^ir^sc^ec"
.I $P(IBENCL,"^",3) S IBRMARK="SC TREATMENT" Q
.I $P(IBENCL,"^",1) S IBRMARK="AGENT ORANGE" Q
.I $P(IBENCL,"^",2) S IBRMARK="IONIZING RADIATION" Q
.I $P(IBENCL,"^",4) S IBRMARK="ENV. CONTAM." Q
;
; -- check for non-billable stops
S X=$P(IBOEDATA,"^",3) I X,$$NBCSC^IBEFUNC(X,+IBOEDATA) S IBRMARK="NON-BILLABLE STOP CODE"
;
; -- ok to add to tracking module
D OPT^IBTUTL1(DFN,IBOETYP,IBDT,IBOE,$G(IBRMARK),$G(IBVSIT)) I '$D(ZTQUEUED),$G(IBTALK) W "+"
I $G(IBRMARK)'="" S IBCNT2=IBCNT2+1
I $G(IBRMARK)="" S IBCNT1=IBCNT1+1
OPCHKQ K IBRMARK,VAEL,VA,IBOEDATA,IBVSIT,DFN,X,Y
Q
;
BULL ; -- send bulletin
;
S XMSUB="Outpatient Encounters added to Claims Tracking Complete"
S IBT(1)="The process to automatically add Opt Encounters has successfully completed."
S IBT(1.1)=""
S IBT(2)=" Start Date: "_$$DAT1^IBOUTL(IBTSBDT)
S IBT(3)=" End Date: "_$$DAT1^IBOUTL(IBTSEDT)
I $D(IBMESS) S IBT(3.1)=IBMESS
S IBT(4)=""
S IBT(5)=" Total Encounters Checked: "_$G(IBCNT)
S IBT(6)=" Total Encounters Added: "_$G(IBCNT1)
S IBT(7)=" Total Non-billable Encounters Added: "_$G(IBCNT2)
S IBT(8)=""
S IBT(9)="*The SC, Agent Orange, Environmental Contaminate, and Ionizing "
S IBT(10)="Radiation visits have been added for insured patients but"
S IBT(11)="automatically indicated as not billable"
D SEND^IBTRKR31
BULLQ Q
IBTRKR41 ;ALB/AAS - CLAIMS TRACKING - ADD/TRACK OUTPATIENT ENCOUNTERS ; 13-AUG-93
+1 ;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
+2 ;;Per VHA Directive 10-93-142, this routine should not be modified.
+3 ;
OPCHK ; -- check and add rx
+1 SET IBCNT=IBCNT+1
+2 KILL IBRMARK
+3 IF '$DATA(ZTQUEUED)
IF ($GET(IBTALK))
WRITE "."
+4 ;
+5 SET IBOEDATA=$GET(^SCE(IBOE,0))
SET IBOESTAT=$PIECE(IBOEDATA,"^",15)
+6 SET DFN=$PIECE(IBOEDATA,"^",2)
+7 IF 'DFN
GOTO OPCHKQ
+8 IF $PIECE(IBOEDATA,"^",5)
SET IBVSIT=$PIECE(IBOEDATA,"^",5)
+9 ;
+10 ; -- not already in claims tracking
+11 ; already in claims tracking
IF $ORDER(^IBT(356,"AENC",+DFN,+IBOE,0))
GOTO OPCHKQ
+12 ; already visit for same date time
IF $ORDER(^IBT(356,"APTY",DFN,IBOETYP,IBDT,0))
GOTO OPCHKQ
+13 ;
+14 ; -- see if tracking only insured and pt is insured
+15 ; patient not insure
IF $PIECE(IBTRKR,"^",4)=1
IF '$$INSURED^IBCNS1(DFN,IBDT)
GOTO OPCHKQ
+16 ;
+17 ; -- check visit status (checked in/out, inpatient, canceled, etc)
+18 ; check out not complete
IF '$PIECE(IBOEDATA,"^",7)
GOTO OPCHKQ
+19 ;is canceled or inpatient or something
IF $PIECE($GET(^DPT(DFN,"S",IBDT,0)),"^",2)'=""
GOTO OPCHKQ
+20 ;
+21 ; -- see if appointment type is billable
+22 IF '$$RPT^IBEFUNC($PIECE(IBOEDATA,"^",10),+IBOEDATA)
SET IBRMARK="NON-BILLABLE APPOINTMENT TYPE"
+23 ;
+24 ; -- is it a primary visit
+25 ; only store primary visits for now
IF $PIECE(IBOEDATA,"^",6)
IF $PIECE(IBOEDATA,"^",6)'=IBOE
GOTO OPCHKQ
+26 ; -- get visit status
+27 ;only checked out encounters can be added
IF $PIECE(IBOEDATA,"^",12)'=2
GOTO OPCHKQ
+28 ;
+29 ; -- check sc status, special conditions etc.
+30 ; return 1 in string if true "ao^ir^sc^ec"
IF $GET(IBRMARK)=""
SET IBENCL=$$ENCL^IBAMTS2(IBOE)
IF IBENCL["1"
Begin DoDot:1
+31 IF $PIECE(IBENCL,"^",3)
SET IBRMARK="SC TREATMENT"
QUIT
+32 IF $PIECE(IBENCL,"^",1)
SET IBRMARK="AGENT ORANGE"
QUIT
+33 IF $PIECE(IBENCL,"^",2)
SET IBRMARK="IONIZING RADIATION"
QUIT
+34 IF $PIECE(IBENCL,"^",4)
SET IBRMARK="ENV. CONTAM."
QUIT
End DoDot:1
+35 ;
+36 ; -- check for non-billable stops
+37 SET X=$PIECE(IBOEDATA,"^",3)
IF X
IF $$NBCSC^IBEFUNC(X,+IBOEDATA)
SET IBRMARK="NON-BILLABLE STOP CODE"
+38 ;
+39 ; -- ok to add to tracking module
+40 DO OPT^IBTUTL1(DFN,IBOETYP,IBDT,IBOE,$GET(IBRMARK),$GET(IBVSIT))
IF '$DATA(ZTQUEUED)
IF $GET(IBTALK)
WRITE "+"
+41 IF $GET(IBRMARK)'=""
SET IBCNT2=IBCNT2+1
+42 IF $GET(IBRMARK)=""
SET IBCNT1=IBCNT1+1
OPCHKQ KILL IBRMARK,VAEL,VA,IBOEDATA,IBVSIT,DFN,X,Y
+1 QUIT
+2 ;
BULL ; -- send bulletin
+1 ;
+2 SET XMSUB="Outpatient Encounters added to Claims Tracking Complete"
+3 SET IBT(1)="The process to automatically add Opt Encounters has successfully completed."
+4 SET IBT(1.1)=""
+5 SET IBT(2)=" Start Date: "_$$DAT1^IBOUTL(IBTSBDT)
+6 SET IBT(3)=" End Date: "_$$DAT1^IBOUTL(IBTSEDT)
+7 IF $DATA(IBMESS)
SET IBT(3.1)=IBMESS
+8 SET IBT(4)=""
+9 SET IBT(5)=" Total Encounters Checked: "_$GET(IBCNT)
+10 SET IBT(6)=" Total Encounters Added: "_$GET(IBCNT1)
+11 SET IBT(7)=" Total Non-billable Encounters Added: "_$GET(IBCNT2)
+12 SET IBT(8)=""
+13 SET IBT(9)="*The SC, Agent Orange, Environmental Contaminate, and Ionizing "
+14 SET IBT(10)="Radiation visits have been added for insured patients but"
+15 SET IBT(11)="automatically indicated as not billable"
+16 DO SEND^IBTRKR31
BULLQ QUIT