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

IBAXDR.m

Go to the documentation of this file.
IBAXDR ;SF-IRMFO/JLI,REM - ROUTINE TO MERGE ENTRIES IN IB FILE FOR PATIENT MERGE ;3/9/98  13:35
 ;;2.0;INTEGRATED BILLING;**94**;21-MAR-94
 ;;Per VHA Directive 10-93-142, this routine should not be modified.
 ;;
 ;;
EN(ARRAY) ; Entry point called with NAME of array containing from, and to entries.
 ;
 N XARRAY,IBDIC,FROMX,TO,FROMX1,TO1,FROM,FRX,TOX
 S XARRAY=$NA(^TMP($J,"IBDUMR1"))
 K @XARRAY
 S FROM=XARRAY
 S IBDIC=$G(^DIC(351.1,0,"GL"))
 I IBDIC="" Q
 F FROMX=0:0 S FROMX=$O(@ARRAY@(FROMX)) Q:FROMX'>0  D
 . S TO=$O(@ARRAY@(FROMX,0))
 . S FROMX1=$O(@(IBDIC_"""B"",FROMX,0)"))
 . S TO1=$O(@(IBDIC_"""B"",TO,0)"))
 . I TO1="",FROMX1="" Q
 . S TO1=$S(TO1>0:TO1,1:0),FROMX1=$S(FROMX1>0:FROMX1,1:0)
 . S FRX=$O(@ARRAY@(FROMX,TO,"")),TOX=$O(@ARRAY@(FROMX,TO,FRX,TOX))
 . S @XARRAY@(FROMX1,TO1,FRX,TOX)=""
 . I FROMX1=0 D  Q
 . . D SAVEMERG^XDRMERGB(351.1,FROMX1,TO1)
 . . K @XARRAY@(FROMX1,TO1)
 . I TO1=0 D  Q
 . . D SAVEMERG^XDRMERGB(351.1,FROMX1,TO1)
 . . K @XARRAY@(FROMX1,TO1)
 . . N IBDXXX
 . . S IBDXXX(351.1,(FROMX1_","),.01)=TO
 . . D UPDATE^DIE("","IBDXXX")
 I '$D(@XARRAY) Q
 D EN^XDRMERG(351.1,"XARRAY") ; NOW CONVERT ANY POINTERS TO THE MERGED ENTRIES
 S IBDIC=$G(^DIC(351.1,0,"GL"))
 I IBDIC'="" D
 . F FROMX=0:0 S FROMX=$O(@XARRAY@(FROMX)) Q:FROMX'>0  K @(IBDIC_FROMX_")")
 Q