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

SCMCLN1.m

Go to the documentation of this file.
  1. SCMCLN1 ;swo/iofobp cleanup utilities ;2.12.2007
  1. ;;5.3;Scheduling;**498**;8.13.1993;Build 23
  1. Q
  1. INST ;check each teams institution and make sure it contains at least the
  1. ;stations base numeric identifier
  1. N SCMCSTA,SCMCL1,SCMCZN,SCMCV1,SCMCNT
  1. S SCMCSTA=$$NS^XUAF4(DUZ(2))
  1. I $G(DUZ(2))="" W !,"Institution is undefined...exiting",!! Q
  1. W !,"Your Station Name: "_$P(SCMCSTA,U)
  1. W !," Number: "_$P(SCMCSTA,U,2)
  1. W !,"This option will output a list of TEAMS whose Station Number association"
  1. W !,"does not match the number listed above.",!!
  1. S (SCMCL1,SCMCNT)=0
  1. F S SCMCL1=$O(^SCTM(404.51,SCMCL1)) Q:'SCMCL1 D
  1. . S SCMCZN=$G(^SCTM(404.51,SCMCL1,0)) Q:SCMCZN=""
  1. . S SCMCV1=$E($P($G(^DIC(4,+$P(SCMCZN,U,7),99)),U),1,3) Q:SCMCV1=""
  1. . I $P(SCMCSTA,U,2)'=SCMCV1 D LOG
  1. . Q
  1. D SHOW,CLEAN
  1. Q
  1. SHOW ;see what we got
  1. S DIOEND="D FOOT^SCMCLN1"
  1. S DIC="^SCTM(404.51,",L=0,BY="@.01",(FR,TO)="",FLDS=".01,.07,.07:99;""STATION #"""
  1. S BY(0)="^TMP(""SCMCLN1"",$J,"
  1. S L(0)=1 D EN1^DIP
  1. Q
  1. LOG ;collect the entries with possible incorrect institution
  1. S ^TMP("SCMCLN1",$J,SCMCL1)=""
  1. S SCMCNT=SCMCNT+1
  1. Q
  1. CLEAN ;clean up
  1. K ^TMP("SCMCLN1",$J)
  1. Q
  1. I SCMCNT<1 W !!,"No problems found.",!! Q
  1. W !!,"The listed entries from the TEAM file need to be reviewed for Institution."
  1. W !,"PCMM GUI clients prior to SD*5.3*297 allowed Team association to any entry"
  1. W !,"in the Institution File."
  1. Q