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

IBPU2.m

Go to the documentation of this file.
  1. IBPU2 ;ALB/BGA - IB PURGE FILE CLEAN UP ; 17-FEB-94
  1. ;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. ; This routine requires IBN from routine IBPP
  1. ; and deletes entries in FILE #399
  1. ;
  1. ; The following procedures remove references which
  1. ; point to the IBN about to be deleted. This routine is
  1. ; invoked by IBPU.
  1. ;
  1. Q:'$G(IBN)
  1. D CLBCOM ; deletes Rec from file 362.1
  1. D CLPSTE ; deletes Rec from file 362.5
  1. D CLCTBI ; deletes Rec from file 356.399
  1. D CLCTRK ; deletes ptr from file 356 field .11
  1. D IBPBIL ; sets the ptr in fld .17 to its self
  1. D IBCYTO ; checks the ptr in fld .15
  1. Q
  1. ;
  1. CLBCOM ; uses "D" xref to find all recs to be deleted
  1. N IBA,DIK,DA
  1. S IBA="" F S IBA=$O(^IBA(362.1,"D",IBN,IBA)) Q:'IBA S DIK="^IBA(362.1,",DA=IBA D ^DIK
  1. Q
  1. ;
  1. CLPSTE ; uses "AIFN_IBN" to find all recs pointing to the rec to be deleted
  1. N IBA,IBB,REF,DIK,DA
  1. S REF="AIFN"_IBN
  1. F IBI=362.5,362.3,362.4 S (IBA,IBB)="" F S IBA=$O(^IBA(IBI,REF,IBA)) Q:'IBA F S IBB=$O(^IBA(IBI,REF,IBA,IBB)) Q:'IBB S DIK="^IBA("_IBI_",",DA=IBB D ^DIK
  1. Q
  1. CLCTBI ; uses "C" xref to find all recs pointing to 399 then deletes
  1. N IBA,IBB,DIK,DA
  1. S IBA="" F S IBA=$O(^IBT(356.399,"C",IBN,IBA)) Q:'IBA S DIK="^IBT(356.399,",DA=IBA D ^DIK
  1. Q
  1. CLCTRK ; uses "E" xref to find all recs ptr to 399 then sets them to null
  1. N IBA,DIE,DA,DR
  1. S IBA="" F S IBA=$O(^IBT(356,"E",IBN,IBA)) Q:'IBA S DIE="^IBT(356,",DA=IBA,DR=".11///@" D ^DIE
  1. Q
  1. IBPBIL ; uses "AC" xref to find all recs ptr to 399 then sets to the bill #
  1. N IBA,DIE,DA,DR
  1. S IBA="" F S IBA=$O(^DGCR(399,"AC",IBN,IBA)) Q:'IBA I IBN'=IBA S DIE="^DGCR(399,",DA=IBA,DR=".17///"_IBA D ^DIE
  1. Q
  1. IBCYTO ; uses "C" xref to find all recs ptr to 399 then sets the recs to null
  1. N IBA,IBB,DFN,DIE,DA,DR
  1. S (IBA,IBB)="",DFN=+$P($G(^DGCR(399,IBN,0)),U,2)
  1. F S IBA=$O(^DGCR(399,"C",DFN,IBA)) Q:'IBA I +$P($G(^DGCR(399,IBA,0)),U,15)=IBN S DIE="^DGCR(399,",DA=IBA,DR=".15///@"
  1. Q