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

XDRMERGC.m

Go to the documentation of this file.
  1. XDRMERGC ;SF-CIOFO/JDS - CHECK MERGE ;06/02/99 09:10
  1. ;;7.3;TOOLKIT;**40**;Jun 1, 1999
  1. ;
  1. Q
  1. CHKFROM(FROM,FILE) ;
  1. ;
  1. ; The following code is used to identify any pairs which have a same internal number in them and to
  1. ; exclude any after the first occurence of the internal number from the current merge
  1. ; the first occurrence is that based on the lowest ien for the FROM entry and the lowest ien for a
  1. ; TO entry associated with it. Any other pairs involving either of these iens is then excluded.
  1. ;
  1. ; The XDRBROWSER1 device is used to capture any output generated due to exclusion of pairs and is
  1. ; then sent as a mail message.
  1. ;
  1. N FRA,TOA,FR,TO
  1. S IOP="XDRBROWSER1" D ^%ZIS
  1. U IO
  1. F FRA=0:0 S FRA=$O(@FROM@(FRA)) Q:FRA'>0 D
  1. . S TOA=$O(@FROM@(FRA,0))
  1. . F FR=FRA,TOA F TO=0:0 S TO=$O(@FROM@(FR,TO)) Q:TO="" I FR'=FRA!(TO'=TOA) D EXCLUDE(FILE,FROM,FR,TO,FR,(TO=FRA))
  1. . F FR=0:0 S FR=$O(@FROM@(FR)) Q:FR'>0 D:$D(@FROM@(FR,FRA)) EXCLUDE(FILE,FROM,FR,FRA,FRA,1) I FR'=FRA D:$D(@FROM@(FR,TOA)) EXCLUDE(FILE,FROM,FR,TOA,TOA,0)
  1. D ^%ZISC K ^TMP("DDB",$J,1)
  1. I $D(^TMP("DDB",$J)) D SENDMESG^XDRDVAL1("PAIRS EXCLUDED FROM MERGE DUE TO MULTIPLE REFERENCES","^TMP(""DDB"",$J,")
  1. Q
  1. ;
  1. EXCLUDE(FILE,FROM,FR,TO,WHICH,FROMREF) ;
  1. N VREF,VFR,VTO
  1. S VREF=""
  1. S VFR=$O(@FROM@(FR,TO,"")) I VFR="" S VFR=0,VREF=@FROM@(FR,TO)
  1. S VTO=$O(@FROM@(FR,TO,VFR,"")) S:VTO="" VTO=0
  1. I VTO>0 S VREF=@FROM@(FR,TO,VFR,VTO)
  1. D RMOVPAIR^XDRDVAL1(FR,TO,VREF,FROM)
  1. D PAIRID^XDRDVAL1(FILE,FR,TO,VREF)
  1. W !," Excluded as a multiple pair including ien=",WHICH,!
  1. I FROMREF>0,VREF>0 D RESET^XDRDPICK(VREF)
  1. Q
  1. ;