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

IBCNSCD3.m

Go to the documentation of this file.
  1. IBCNSCD3 ;ALB/CPM - DELETE INSURANCE COMPANY (CON'T) ; 11-MAY-95
  1. ;;Version 2.0 ; INTEGRATED BILLING ;**28,46**; 21-MAR-94
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. MERGE ; Determine whether company information must be merged to another.
  1. ; Required variable input:
  1. ; IBCNS -- Pointer to the company in file #36
  1. ;
  1. ; Variable output:
  1. ; IBCALLAR -- Set to 1 if billing activity must be re-pointed
  1. ; IBCALLIR -- Set to 1 if Insurance reviews must be re-pointed
  1. ; IBREP -- Pointer to a company in file #36, or 0
  1. ; IBREPN -- May be set to an insurance company name
  1. ; IBQUIT -- Set to 1 if the user wants to quit the option
  1. ;
  1. N IBAR,IBMERGE,IBCNSRD,IBCNSRD1
  1. W !!,$TR($J("",80)," ","="),!
  1. S (IBCALLAR,IBCALLIR,IBMERGE,IBREP,IBQUIT)=0
  1. ;
  1. ; - check AR to see if the company is filed as a debtor
  1. S IBAR=+$$DEL^RCAMINS(IBCNS)
  1. I 'IBAR W !?3,">> This company is not established as a debtor in Accounts Receivable.",!
  1. I IBAR=1 W !?3,">> There is a debtor, but no bills, for this company in Accounts Receivable.",!
  1. I IBAR=2 S (IBCALLAR,IBMERGE)=1 W !?3,">> There is billing activity associated with this company!",!
  1. ;
  1. ; - see if there are Insurance Reviews for the company
  1. I $D(^IBT(356.2,"AIACT",IBCNS)) S (IBCALLIR,IBMERGE)=1 W !?3,">> There are known Insurance Reviews associated with this company.",!
  1. ;
  1. I 'IBMERGE W !,"** This company may be deleted from your system without merging. **" G MERGEQ
  1. ;
  1. ; - select another company to merge information into
  1. W !!,"You must merge the information from this company into another company!",!
  1. S IBCNSRD=$P($G(^DIC(36,IBCNS,0)),"^",16)
  1. I IBCNSRD,$G(^DIC(36,IBCNSRD,0))]"" S IBCNSRD=$G(^(0)),IBCNSRD1=$G(^(.11)) D
  1. .W !?2,"Please note that insurance policy and plan information was repointed to:"
  1. .W !?6,$P(IBCNSRD,"^")," (",$S($P(IBCNSRD,"^",5):"Ina",1:"A"),"ctive Company)"
  1. .I $P(IBCNSRD1,"^")]"" W !?6,$P(IBCNSRD1,"^")
  1. .I $P(IBCNSRD1,"^",2)]"" W !?6,$P(IBCNSRD1,"^",2)
  1. .I $P(IBCNSRD1,"^",3)]"" W !?6,$P(IBCNSRD1,"^",3)
  1. .I $P(IBCNSRD1,"^",4)]"" W !?6,$P(IBCNSRD1,"^",4)," ",$P($G(^DIC(5,+$P(IBCNSRD1,"^",5),0)),"^",2)," ",$E($P(IBCNSRD1,"^",6),1,5),$S($E($P(IBCNSRD1,"^",6),6,9)]"":"-"_$E($P(IBCNSRD1,"^",6),6,9),1:"")
  1. ;
  1. S DIC(0)="QEAMZ",DIC="^DIC(36,",DIC("A")="Select Company to Merge Information: ",DIC("S")="I +Y'=IBCNS,'$G(^(5))",DIC("W")="D ID^IBCNSCD3"
  1. W ! D ^DIC K DIC S IBREP=+Y I Y<0 S IBQUIT=1 W !!,"No 'merge' company selected!" G MERGEQ
  1. I IBCALLAR,$$DEL^RCAMINS(IBREP)<1 W !!,"This company is not established as a debtor in Accounts Receivable!",!,"It will be established as a debtor prior to merging the billing activity."
  1. S IBREPN=Y(0,0)
  1. MERGEQ Q
  1. ;
  1. ;
  1. INTRO ; Introductory text.
  1. W !!,"This action is designed to allow the deletion of Insurance companies"
  1. W !,"which meet one of the following criteria:"
  1. W !!," o The company was entered by error, and there is little or no insurance"
  1. W !," or billing activity associated with the company."
  1. W !!," o The company is really the same company as another entry in your file"
  1. W !," and you wish to merge all activity for the company to the other entry."
  1. W !!,"It is not necessary, nor desirable, to delete every company which is inactive."
  1. Q
  1. ;
  1. WARN ; Describe how the delete/merge will work.
  1. W !!,$TR($J("",70)," ","*")
  1. W !,"There may be entries in various files which point to ",$P(IBCNSD,"^")
  1. W !,"which are not immediately obvious. ",$S(IBREP:"Merg",1:"Delet"),"ing this company"
  1. W !,"will cause a background job to be queued later in the day which will"
  1. W !,"find all such entries and delete or merge these pointers as necessary."
  1. W !!,"You will receive a mail message from the system when this job is complete."
  1. W !,"Please note that there is a potential problem where pointers will be"
  1. W !,"deleted when there is no company into which the pointed fields may be"
  1. W !,"merged. The mail message will indicate which records those are so they"
  1. W !,"may be reviewed.",!,$TR($J("",70)," ","*")
  1. Q
  1. ;
  1. HLP ; Reader help for deleting companies
  1. I 'IBREP W !!,"If you wish to delete this company, enter 'YES.' Otherwise, enter 'NO.'" Q
  1. W !!,"If you enter 'YES,' all information pertaining to ",$P(IBCNSD,"^")
  1. W !,"will be repointed to ",IBREPN,". ",$P(IBCNSD,"^")
  1. W !,"will then be flagged for deletion from your system."
  1. W !!,"If you do not want this action to occur, enter 'NO.'"
  1. Q
  1. ;
  1. ID ; Display the company identifer.
  1. N IB
  1. W:$D(^(.11)) " ",$P(^(.11),U,1)," ",$P(^(.11),U,4)
  1. S IB=Y,Y=$S('$D(^(.11)):"",$D(^DIC(5,+$P(^(.11),U,5),0))#2:$P(^(0),U,1),1:""),C=$P(^DD(5,.01,0),U,2) D Y^DIQ:Y]"" W " ",Y,@("$E("_DIC_"IB,0),0)") S Y=IB
  1. W:$D(^(0)) " ",$P(^(0),U,2)
  1. W " (ien: ",+Y,")"
  1. Q