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

TIUEN165.m

Go to the documentation of this file.
  1. TIUEN165 ; SLC/MAM - Environment Check Rtn for TIU*1*165;6/16/03
  1. ;;1.0;Text Integration Utilities;**165**;Jun 20, 1997
  1. MAIN ; Check environment
  1. ; -- Set data for DDEFs to export:
  1. D SETXTMP
  1. ; -- Check for potential DDEF duplicates at site:
  1. N TIUDUPS
  1. D TIUDUPS(.TIUDUPS)
  1. ; -- If potential duplicates exist, abort install:
  1. I 'TIUDUPS W !,"Document Definitions look OK." Q
  1. S XPDABORT=1 W !,"Aborting Install..."
  1. Q
  1. ;
  1. SETXTMP ; Set up ^XTMP global
  1. S ^XTMP("TIU165",0)=304301_U_DT
  1. ; -- Set basic data for new DDEFS into ^XTMP.
  1. ; Reference DDEFS by NUMBER.
  1. ; Number parent-to-be BEFORE child.
  1. ; -- DDEF Number 1:
  1. S ^XTMP("TIU165","BASICS",1,"NAME")="PATIENT RECORD FLAG CAT I"
  1. S ^XTMP("TIU165","BASICS",1,"INTTYPE")="DC"
  1. ; -- DDEF Number 2:
  1. S ^XTMP("TIU165","BASICS",2,"NAME")="PATIENT RECORD FLAG CAT II"
  1. S ^XTMP("TIU165","BASICS",2,"INTTYPE")="DC"
  1. ; -- DDEF Number 3:
  1. S ^XTMP("TIU165","BASICS",3,"NAME")="PATIENT RECORD FLAG CATEGORY I"
  1. S ^XTMP("TIU165","BASICS",3,"INTTYPE")="DOC"
  1. ; -- DDEF Number 4:
  1. S ^XTMP("TIU165","BASICS",4,"NAME")="PATIENT RECORD FLAG CATEGORY II - RISK, FALL"
  1. S ^XTMP("TIU165","BASICS",4,"INTTYPE")="DOC"
  1. ; -- DDEF Number 5:
  1. S ^XTMP("TIU165","BASICS",5,"NAME")="PATIENT RECORD FLAG CATEGORY II - RISK, WANDERING"
  1. S ^XTMP("TIU165","BASICS",5,"INTTYPE")="DOC"
  1. ; -- DDEF Number 6:
  1. S ^XTMP("TIU165","BASICS",6,"NAME")="PATIENT RECORD FLAG CATEGORY II - RESEARCH STUDY"
  1. S ^XTMP("TIU165","BASICS",6,"INTTYPE")="DOC"
  1. ; -- DDEF Number 7:
  1. S ^XTMP("TIU165","BASICS",7,"NAME")="PATIENT RECORD FLAG CATEGORY II - INFECTIOUS DISEASE"
  1. S ^XTMP("TIU165","BASICS",7,"INTTYPE")="DOC"
  1. Q
  1. ;
  1. TIUDUPS(TIUDUPS,SILENT) ; Set array of potential duplicates
  1. N NUM S (NUM,TIUDUPS)=0
  1. F S NUM=$O(^XTMP("TIU165","BASICS",NUM)) Q:'NUM D
  1. . ; -- When looking for duplicates, ignore DDEF if
  1. . ; previously created by this patch:
  1. . Q:$G(^XTMP("TIU165","BASICS",NUM,"DONE"))
  1. . ; -- If site already has DDEF w/ same Name & Type as one
  1. . ; we are exporting, set its number into array TIUDUPS:
  1. . N NAME,TYPE,TIUY S TIUY=0
  1. . S NAME=^XTMP("TIU165","BASICS",NUM,"NAME"),TYPE=^XTMP("TIU165","BASICS",NUM,"INTTYPE")
  1. . F S TIUY=$O(^TIU(8925.1,"B",NAME,TIUY)) Q:+TIUY'>0 D
  1. . . I $P($G(^TIU(8925.1,+TIUY,0)),U,4)=TYPE S TIUDUPS(NUM)=+TIUY,TIUDUPS=1
  1. ; -- Write list of duplicates:
  1. I +TIUDUPS,'$G(SILENT) D
  1. . W !,"You already have the following Document Definitions exported by this patch."
  1. . W !,"I don't want to overwrite them. Please change their names so they no longer"
  1. . W !,"match the exported ones, or if you are not using them, delete them."
  1. . W !!,"If you change the name of a Document Definition, remember to update its Print"
  1. . W !,"Name, as well. For help, contact National VistA Support."
  1. . N NUM S NUM=0
  1. . F S NUM=$O(TIUDUPS(NUM)) Q:'NUM D
  1. . . W !?5,^XTMP("TIU165","BASICS",NUM,"NAME")
  1. Q