IBCNSM31 ;ALB/AAS - INSURANCE MANAGEMENT - OUTPUTS ; 28-MAY-93
;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
;;Per VHA Directive 10-93-142, this routine should not be modified.
;
% G EN^IBCNSM
;
EA ; -- Edit all insurance policy data
N IBDIF,I,J,IBXX,IBCDFN,IBTRC,VALMY
D EN^VALM2($G(XQORNOD(0)))
D FULL^VALM1
I $D(VALMY) S IBXX=0 F S IBXX=$O(VALMY(IBXX)) Q:'IBXX D ;W !,"Entry ",X,"Selected" D
.S IBPPOL=$G(^TMP("IBNSMDX",$J,$O(^TMP("IBNSM",$J,"IDX",IBXX,0))))
.Q:IBPPOL=""
.S IBCDFN=$P($G(IBPPOL),"^",4) I 'IBCDFN W !!,"Can't identify the policy!" Q
.; -- edit patient data
.N IBQUIT S IBQUIT=0
.S IBCNSEH=$P($G(^IBE(350.9,1,4)),"^",1) D PAT^IBCNSEH
.D PATPOL^IBCNSM3(IBCDFN)
.; -- edit policy data
.D:'$G(IBQUIT) POL^IBCNSEH,EDPOL^IBCNSM3(IBCDFN)
.W ! D AI^IBCNSP1 D:$G(IBTRC) AIP^IBCNSP02(IBTRC)
.Q
;
EAQ D BLD^IBCNSM
S VALMBCK="R"
Q
;
LK(IBCNS) ; -- screened look up to policy file
; input: IBCNS = pointer to insurance company file (36)
;
N DIC,IBX
S IBCPOL=""
I $G(IBCNS)="" G LKQ
;
; -- first see if any plans for this company
S IBX=$O(^IBA(355.3,"B",+IBCNS,0)) I 'IBX G LKQ
;
; -- see if only one policy
;I '$O(^IBA(355.3,"B",+IBCNS,IBX) D G LKQ
;
; -- is more than one plan to choose from, let fileman do it.
S DIC("A")="Select GROUP INSURANCE PLAN: "
;
S DIC="^IBA(355.3,",DIC(0)="AEQM",DIC("S")="I $P(^(0),U)=IBCNS,($P(^(0),U,2)=1!($P(^(0),U,10)=$G(DFN)))"
;
D ^DIC K DIC I +Y>0 S IBCPOL=+Y
;
LKQ Q IBCPOL
;
FUTURE ; -- if expiration date in future give warning
I $G(IBFUTUR) K IBFUTUR Q
I $P(^DPT(DFN,.312,IBCDFN,0),"^",4),$P(^(0),"^",4)>DT W !!,*7,"WARNING: The expiration date for this policy is in the future!",!," Normally this is a past date or left blank or a past date",! S Y="@333"
S IBFUTUR=1
Q
;
COVERED(DFN,IBCOVP) ; -- update covered by insurance in background
; -- input ibcovp = the covered by insurance field prior to editing
; (add/edit/delete) of the 2.312 insurance type mult.
;
Q:$G(DFN)<1
N X,Y,I,IBCOV,IBNCOV,DA,DR,DIE,DIC,IBINS,IBINSD
S (IBCOV,IBNCOV)=$P($G(^DPT(DFN,.31)),"^",11)
D ALL^IBCNS1(DFN,"IBINS",2,DT) S IBINSD=+$G(IBINS(0))
;
; -- initial value ="" or Unknown
I $G(IBCOVP)=""!($G(IBCOVP)="U") S IBNCOV=$S('$O(^DPT(DFN,.312,0)):"U",IBINSD:"Y",1:"N")
;
; -- initial value = YES or NO (treat the same)
I $G(IBCOVP)="Y"!($G(IBCOVP)="N") S IBNCOV=$S('$O(^DPT(DFN,.312,0)):"N",IBINSD:"Y",1:"N")
;
;
I IBCOV'=IBNCOV D
.S DIE="^DPT(",DR=".3192////"_IBNCOV,DA=DFN D ^DIE
.I '$D(ZTQUEUED) W !!,"COVERED BY HEALTH INSURANCE changed to '"_$S(IBNCOV="Y":"YES",IBNCOV="N":"NO",1:"UNKNOWN"),"'.",!
.H 3
.Q
Q
;
3 ; -- display group name as uneditable
; called by die, expects da = entry in 355.3
N X
S X=$P($G(^IBA(355.3,DA,0)),"^",3)
W !,"GROUP NAME: ",X,$S(X'="":"// ",1:"")," (No Editing)"
Q
;
4 ; -- display group number as uneditable
; called by die, expects da = entry in 355.3
N X
S X=$P($G(^IBA(355.3,DA,0)),"^",4)
W !,"GROUP NUMBER: ",X,$S(X'="":"// ",1:"")," (No Editing)"
Q
IBCNSM31 ;ALB/AAS - INSURANCE MANAGEMENT - OUTPUTS ; 28-MAY-93
+1 ;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
+2 ;;Per VHA Directive 10-93-142, this routine should not be modified.
+3 ;
% GOTO EN^IBCNSM
+1 ;
EA ; -- Edit all insurance policy data
+1 NEW IBDIF,I,J,IBXX,IBCDFN,IBTRC,VALMY
+2 DO EN^VALM2($GET(XQORNOD(0)))
+3 DO FULL^VALM1
+4 ;W !,"Entry ",X,"Selected" D
IF $DATA(VALMY)
SET IBXX=0
FOR
SET IBXX=$ORDER(VALMY(IBXX))
IF 'IBXX
QUIT
Begin DoDot:1
+5 SET IBPPOL=$GET(^TMP("IBNSMDX",$JOB,$ORDER(^TMP("IBNSM",$JOB,"IDX",IBXX,0))))
+6 IF IBPPOL=""
QUIT
+7 SET IBCDFN=$PIECE($GET(IBPPOL),"^",4)
IF 'IBCDFN
WRITE !!,"Can't identify the policy!"
QUIT
+8 ; -- edit patient data
+9 NEW IBQUIT
SET IBQUIT=0
+10 SET IBCNSEH=$PIECE($GET(^IBE(350.9,1,4)),"^",1)
DO PAT^IBCNSEH
+11 DO PATPOL^IBCNSM3(IBCDFN)
+12 ; -- edit policy data
+13 IF '$GET(IBQUIT)
DO POL^IBCNSEH
DO EDPOL^IBCNSM3(IBCDFN)
+14 WRITE !
DO AI^IBCNSP1
IF $GET(IBTRC)
DO AIP^IBCNSP02(IBTRC)
+15 QUIT
End DoDot:1
+16 ;
EAQ DO BLD^IBCNSM
+1 SET VALMBCK="R"
+2 QUIT
+3 ;
LK(IBCNS) ; -- screened look up to policy file
+1 ; input: IBCNS = pointer to insurance company file (36)
+2 ;
+3 NEW DIC,IBX
+4 SET IBCPOL=""
+5 IF $GET(IBCNS)=""
GOTO LKQ
+6 ;
+7 ; -- first see if any plans for this company
+8 SET IBX=$ORDER(^IBA(355.3,"B",+IBCNS,0))
IF 'IBX
GOTO LKQ
+9 ;
+10 ; -- see if only one policy
+11 ;I '$O(^IBA(355.3,"B",+IBCNS,IBX) D G LKQ
+12 ;
+13 ; -- is more than one plan to choose from, let fileman do it.
+14 SET DIC("A")="Select GROUP INSURANCE PLAN: "
+15 ;
+16 SET DIC="^IBA(355.3,"
SET DIC(0)="AEQM"
SET DIC("S")="I $P(^(0),U)=IBCNS,($P(^(0),U,2)=1!($P(^(0),U,10)=$G(DFN)))"
+17 ;
+18 DO ^DIC
KILL DIC
IF +Y>0
SET IBCPOL=+Y
+19 ;
LKQ QUIT IBCPOL
+1 ;
FUTURE ; -- if expiration date in future give warning
+1 IF $GET(IBFUTUR)
KILL IBFUTUR
QUIT
+2 IF $PIECE(^DPT(DFN,.312,IBCDFN,0),"^",4)
IF $PIECE(^(0),"^",4)>DT
WRITE !!,*7,"WARNING: The expiration date for this policy is in the future!",!," Normally this is a past date or left blank or a past date",!
SET Y="@333"
+3 SET IBFUTUR=1
+4 QUIT
+5 ;
COVERED(DFN,IBCOVP) ; -- update covered by insurance in background
+1 ; -- input ibcovp = the covered by insurance field prior to editing
+2 ; (add/edit/delete) of the 2.312 insurance type mult.
+3 ;
+4 IF $GET(DFN)<1
QUIT
+5 NEW X,Y,I,IBCOV,IBNCOV,DA,DR,DIE,DIC,IBINS,IBINSD
+6 SET (IBCOV,IBNCOV)=$PIECE($GET(^DPT(DFN,.31)),"^",11)
+7 DO ALL^IBCNS1(DFN,"IBINS",2,DT)
SET IBINSD=+$GET(IBINS(0))
+8 ;
+9 ; -- initial value ="" or Unknown
+10 IF $GET(IBCOVP)=""!($GET(IBCOVP)="U")
SET IBNCOV=$SELECT('$ORDER(^DPT(DFN,.312,0)):"U",IBINSD:"Y",1:"N")
+11 ;
+12 ; -- initial value = YES or NO (treat the same)
+13 IF $GET(IBCOVP)="Y"!($GET(IBCOVP)="N")
SET IBNCOV=$SELECT('$ORDER(^DPT(DFN,.312,0)):"N",IBINSD:"Y",1:"N")
+14 ;
+15 ;
+16 IF IBCOV'=IBNCOV
Begin DoDot:1
+17 SET DIE="^DPT("
SET DR=".3192////"_IBNCOV
SET DA=DFN
DO ^DIE
+18 IF '$DATA(ZTQUEUED)
WRITE !!,"COVERED BY HEALTH INSURANCE changed to '"_$SELECT(IBNCOV="Y":"YES",IBNCOV="N":"NO",1:"UNKNOWN"),"'.",!
+19 HANG 3
+20 QUIT
End DoDot:1
+21 QUIT
+22 ;
3 ; -- display group name as uneditable
+1 ; called by die, expects da = entry in 355.3
+2 NEW X
+3 SET X=$PIECE($GET(^IBA(355.3,DA,0)),"^",3)
+4 WRITE !,"GROUP NAME: ",X,$SELECT(X'="":"// ",1:"")," (No Editing)"
+5 QUIT
+6 ;
4 ; -- display group number as uneditable
+1 ; called by die, expects da = entry in 355.3
+2 NEW X
+3 SET X=$PIECE($GET(^IBA(355.3,DA,0)),"^",4)
+4 WRITE !,"GROUP NUMBER: ",X,$SELECT(X'="":"// ",1:"")," (No Editing)"
+5 QUIT