Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: IBCNSJ21

IBCNSJ21.m

Go to the documentation of this file.
  1. IBCNSJ21 ;ALB/CPM - CHANGE POLICY PLAN (CON'T) ; 12-JAN-95
  1. ;;Version 2.0 ; INTEGRATED BILLING ;**28**; 21-MAR-94
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. NOTES ; Display any necessary notes to the user.
  1. N IBS S IBS=0
  1. S IBIP='$P(IBPLAND,"^",2) I IBIP S IBS=1 W !,"Please note that this is an Individual Plan."
  1. I $P(IBPLAND,"^",11) S IBS=1 W !,*7,"This plan is currently inactive."
  1. D BU I $O(IBBU(0)) S IBS=1 W !,*7,"There are Benefits Used associated with this plan!"
  1. I $O(^IBA(355.7,"APP",DFN,IBCDFN,0)) S IBS=1 W !,*7,"This patient has riders associated with this policy!"
  1. I $$IR(DFN,IBCDFN) S IBS=1 W !,*7,"There are insurance reviews associated with this policy."
  1. W:IBS !
  1. Q
  1. ;
  1. BU ; Are there any benefits used for this plan and policy?
  1. ; Input variables required:
  1. ; DFN -- ptr to patient in file #2
  1. ; IBPLAN -- ptr to policy plan in file #355.3
  1. ; IBCDFN -- ptr to policy in sub-file #2.312
  1. ;
  1. ; Output variable array:
  1. ; IBBU(X)=Y -- array of benefits used associated with the policy,
  1. ; where X is the benefit year, and Y points to the bu
  1. ; in file #355.5
  1. N DATE,POL
  1. S DATE="" F S DATE=$O(^IBA(355.5,"APPY",DFN,IBPLAN,DATE)) Q:DATE="" D
  1. .S POL=0 F S POL=$O(^IBA(355.5,"APPY",DFN,IBPLAN,DATE,POL)) Q:'POL I POL=IBCDFN S IBBU(-DATE)=$O(^(POL,0))
  1. Q
  1. ;
  1. AB ; Find all Annual Benefits associated with an Insurance Plan.
  1. ; Input variables required:
  1. ; IBCPOL -- ptr to proposed plan in file #355.3
  1. ;
  1. ; Output variable array:
  1. ; IBAB(X) -- array of annual benefits, where X is the benefit year
  1. ;
  1. N X S X=""
  1. F S X=$O(^IBA(355.4,"APY",IBCPOL,X)) Q:X="" S IBAB(-X)=""
  1. Q
  1. ;
  1. IR(DFN,IBCDFN) ; Are there any Insurance reviews associated with the policy?
  1. ; Input: DFN -- Pointer to the patient in file #2
  1. ; IBCDFN -- Pointer to the policy in file #2.312
  1. ; Output: 1 -- There are associated insurance reviews, or
  1. ; 0 -- there are not.
  1. N X,Y S X=0
  1. I $G(DFN),$G(IBCDFN) S Y=0 F S Y=$O(^IBT(356.2,"D",DFN,Y)) Q:'Y I $P($G(^IBT(356.2,Y,1)),"^",5)=IBCDFN S X=1 Q
  1. Q X
  1. ;
  1. DMBU ; Display mergeable benefits used.
  1. N IBMRG
  1. S X=0 F S X=$O(IBAB(X)) Q:'X S IBMRG(X)=""
  1. S X=0 F S X=$O(IBBU(X)) Q:'X S IBMRG(X)=""
  1. W !!," Existing Benefit Used Yr",?31,"Annual Benefit for Proposed Plan",?66,"Merge BU?",!
  1. S X=0 F S X=$O(IBMRG(X)) Q:'X D
  1. .W ! W:$D(IBBU(X)) ?6,$$DAT2^IBOUTL(X) W:$D(IBAB(X)) ?40,$$DAT2^IBOUTL(X)
  1. .W ?69 I '$D(IBAB(X)) W "NO" S IBMRGN=1 Q
  1. .I '$D(IBBU(X)) W "-na-" Q
  1. .S IBMRGF(X)=IBBU(X) W "YES"
  1. Q
  1. ;
  1. MD ; Merge/delete benefits used, if necessary.
  1. I $G(IBMERGE) D
  1. .W !,"Merging previous benefits used into the new plan... "
  1. .S IBX="" F S IBX=$O(IBMRGF(IBX)) Q:IBX="" D MERG^IBCNSJ13(IBCPOL,+IBMRGF(IBX)) K IBBU(IBX)
  1. .W "done."
  1. ;
  1. ; - delete any remaining benefits used
  1. I $O(IBBU(0)) D
  1. .W !,"Deleting previous benefits used... "
  1. .S IBX="" F S IBX=$O(IBBU(IBX)) Q:IBX="" D DBU^IBCNSJ(IBBU(IBX))
  1. .W "done."
  1. MDQ Q
  1. ;
  1. HLSW ; Reader help for switching plans.
  1. W !!,"If you wish to change the subscribed-to plan the newly-",$S($G(IBNEWP):"added",1:"selected")," plan,"
  1. W !,"enter 'YES'. Otherwise, enter 'NO'."
  1. Q:'$O(IBBU(0))
  1. W !!,"If you change the plan for this policy, "
  1. I '$G(IBMERGE)!'$O(IBMRGF(0)) W "all existing benefits will be deleted." Q
  1. I '$G(IBMRGN) W "all existing benefits will be merged." Q
  1. W "all transferable benefits",!,"will be merged. All others will be deleted."
  1. Q