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

DIPR157.m

Go to the documentation of this file.
  1. DIPR157 ;O-OIFO/GMB-Functions: Delete SETDATA. Add DUPLICATED ;03/27/2008
  1. ;;22.0;VA FileMan;**157**;Mar 30, 1999;Build 9
  1. ;Per VHA Directive 2004-038, this routine should not be modified.
  1. ENV ; Environmental Check
  1. N DELFUNC,ADDFUNC
  1. D BMES^XPDUTL("Perform Environment Check...")
  1. D CHKSTOP
  1. D INIT
  1. I $D(DELFUNC) D CHKDEL
  1. I $D(ADDFUNC) D CHKADD
  1. D BMES^XPDUTL("Finished Environment Check.")
  1. Q
  1. CHKDEL ;
  1. D BMES^XPDUTL("Checking Function(s) to be deleted from FUNCTION file ^DD(""FUNC""...")
  1. N IEN
  1. S IEN=0
  1. F S IEN=$O(DELFUNC(IEN)) Q:'IEN D
  1. . S DELFUNC=DELFUNC(IEN,0)
  1. . D BMES^XPDUTL("...Checking for function "_DELFUNC_" at IEN "_IEN)
  1. . I '$D(^DD("FUNC",IEN)) D Q
  1. . . D MES^XPDUTL("...Already deleted.")
  1. . I $D(ADDFUNC(IEN,0)),$G(^DD("FUNC",IEN,0))=ADDFUNC(IEN,0) D Q
  1. . . D MES^XPDUTL("...Already deleted.")
  1. . I '$$OKFUNC(.DELFUNC,IEN) D Q
  1. . . D MES^XPDUTL("...Something's not right. Notify SD&D.")
  1. . . S XPDQUIT=2
  1. . D MES^XPDUTL("...Looks OK. We'll delete it in the Post-Init.")
  1. Q
  1. CHKADD ;
  1. D BMES^XPDUTL("Checking Function(s) to be added to FUNCTION file ^DD(""FUNC""...")
  1. N IEN
  1. S IEN=0
  1. F S IEN=$O(ADDFUNC(IEN)) Q:'IEN D
  1. . S ADDFUNC=ADDFUNC(IEN,0)
  1. . D BMES^XPDUTL("...Checking for function "_ADDFUNC_" at IEN "_IEN)
  1. . I $D(^DD("FUNC",IEN)) D Q
  1. . . D MES^XPDUTL("...Found something at that IEN. Checking it out.")
  1. . . I $D(DELFUNC(IEN,0)),$G(^DD("FUNC",IEN,0))=DELFUNC(IEN,0) D Q
  1. . . . D MES^XPDUTL("...It's "_DELFUNC(IEN,0)_". We'll replace it with "_ADDFUNC_" in the Post-Init.")
  1. . . I '$$OKFUNC(.ADDFUNC,IEN) D Q
  1. . . . S XPDQUIT=2
  1. . . . D MES^XPDUTL("...Something's not right. Notify SD&D.")
  1. . . D MES^XPDUTL("...Looks OK - "_ADDFUNC_" is already there.")
  1. . D MES^XPDUTL("...It's not there. We'll add it in the Post-Init.")
  1. Q
  1. POSTINIT ; Post-Init
  1. N COUNT,DELFUNC,ADDFUNC
  1. D BMES^XPDUTL("Beginning Post-Installation...")
  1. S COUNT=0
  1. D INIT
  1. I $D(DELFUNC) D DELFUNC
  1. I $D(ADDFUNC) D ADDFUNC
  1. D END
  1. D BMES^XPDUTL("Finished Post-Installation.")
  1. Q
  1. INIT ;
  1. ; Delete the following function(s):
  1. S DELFUNC(57,0)="SETDATA"
  1. S DELFUNC(57,1)="S X1=X"
  1. S DELFUNC(57,3)=2
  1. S DELFUNC(57,9)="SETS FIRST ARGUMENT EQUAL TO THE SECOND ARGUMENT"
  1. ;
  1. ; Add the following function(s):
  1. S ADDFUNC(57,0)="DUPLICATED"
  1. S ADDFUNC(57,1)="S X=X"
  1. S ADDFUNC(57,3)=1
  1. S ADDFUNC(57,9)="Takes as argument the name of a CROSS-REFERENCED field. Returns BOOLEAN value, 1=field value is duplicated in another entry, """"=field value is unique"
  1. Q
  1. DELFUNC ;
  1. D BMES^XPDUTL("Deleting Function(s) from FUNCTION file ^DD(""FUNC""...")
  1. N IEN
  1. S IEN=0
  1. F S IEN=$O(DELFUNC(IEN)) Q:'IEN D
  1. . S DELFUNC=DELFUNC(IEN,0)
  1. . D BMES^XPDUTL("...Checking for function "_DELFUNC_" at IEN "_IEN)
  1. . I '$D(^DD("FUNC",IEN)) D Q
  1. . . I $D(^DD("FUNC","B",DELFUNC,IEN)) K ^(IEN)
  1. . . D MES^XPDUTL("...Already deleted.")
  1. . I $D(ADDFUNC(IEN,0)),$G(^DD("FUNC",IEN,0))=ADDFUNC(IEN,0) D Q
  1. . . I $D(^DD("FUNC","B",DELFUNC,IEN)) K ^(IEN)
  1. . . D MES^XPDUTL("...Already deleted.")
  1. . I '$$OKFUNC(.DELFUNC,IEN) D Q
  1. . . D MES^XPDUTL("...Something's not right. Notify SD&D.")
  1. . D MES^XPDUTL("...Deleting Function "_DELFUNC_" ...")
  1. . K ^DD("FUNC",IEN)
  1. . K ^DD("FUNC","B",DELFUNC,IEN)
  1. . D MES^XPDUTL("...Deleted.")
  1. . S COUNT=COUNT-1
  1. Q
  1. ADDFUNC ;
  1. D BMES^XPDUTL("Adding Function(s) to FUNCTION file ^DD(""FUNC""...")
  1. N IEN,I
  1. S IEN=0
  1. F S IEN=$O(ADDFUNC(IEN)) Q:'IEN D
  1. . S ADDFUNC=ADDFUNC(IEN,0)
  1. . D BMES^XPDUTL("...Checking for function "_ADDFUNC_" at IEN "_IEN)
  1. . I $D(^DD("FUNC",IEN)) D Q
  1. . . D MES^XPDUTL("...Found something at that IEN. Checking it out.")
  1. . . I '$$OKFUNC(.ADDFUNC,IEN) D Q
  1. . . . D MES^XPDUTL("...Something's not right. Notify SD&D.")
  1. . . D MES^XPDUTL("...Looks OK - "_ADDFUNC_" is already there.")
  1. . D MES^XPDUTL("...Adding Function "_ADDFUNC_" ...")
  1. . S I=""
  1. . F S I=$O(ADDFUNC(IEN,I)) Q:I="" S ^DD("FUNC",IEN,I)=ADDFUNC(IEN,I)
  1. . S ^DD("FUNC","B",ADDFUNC,IEN)=""
  1. . D MES^XPDUTL("...Added.")
  1. . S COUNT=COUNT+1
  1. Q
  1. OKFUNC(FUNC,IEN) ; Check existing Function
  1. N I,OK
  1. S I="",OK=1
  1. F S I=$O(^DD("FUNC",IEN,I)) Q:I="" I ^(I)'=$G(FUNC(IEN,I)) D
  1. . S OK=0
  1. . I I=9 D MES^XPDUTL("...Node "_I_" does not match expected value.") Q
  1. . D MES^XPDUTL("...Node "_I_"='"_NODEI_"' - Expected: '"_$G(FUNC(IEN,I))_"'")
  1. Q:'OK 0
  1. S I=""
  1. F S I=$O(FUNC(IEN,I)) Q:I="" I $G(^DD("FUNC",IEN,I))'=FUNC(IEN,I) D
  1. . S OK=0
  1. . I I=9 D MES^XPDUTL("...Node "_I_" does not match expected value.") Q
  1. . D MES^XPDUTL("...Node "_I_"='"_$G(^DD("FUNC",IEN,I))_"' - Expected: '"_FUNC(IEN,I)_"'")
  1. Q OK
  1. END ;
  1. Q:'COUNT ; Count piece doesn't need updating
  1. ; Update 4th piece of Zeroth node
  1. L +^DD("FUNC",0):5 S $P(^(0),U,4)=$P(^DD("FUNC",0),U,4)+COUNT I L -^DD("FUNC",0)
  1. Q
  1. CHKSTOP ;
  1. ; Check XPDENV 0 = Loading; 1 = Installing
  1. I 'XPDENV Q ; Loading Distribution - No Check
  1. ;
  1. ;
  1. INSCHK ; Do Checks During Install Only
  1. W $C(7)
  1. D MES^XPDUTL("** Although Queuing is allowed - it is HIGHLY recommended that ALL Users and")
  1. D MES^XPDUTL("VISTA Background jobs be STOPPED before installation of this patch. Failure")
  1. D MES^XPDUTL("to do so may result in 'source routine edited' error(s). Edits will be")
  1. D MES^XPDUTL("lost and record(s) may be left in an inconsistent state, for example,")
  1. D MES^XPDUTL("not all Cross-Referencing completed; which in turn may cause FUTURE")
  1. D MES^XPDUTL("VistA/FileMan Hard Errors or corrupted Data. **")
  1. ;
  1. TMCHK ; Check to see if TaskMan is still running
  1. S X=$$TM^%ZTLOAD
  1. I X,'$D(^%ZTSCH("WAIT")) D
  1. . W $C(7)
  1. . D BMES^XPDUTL("* Warning TaskMan Has NOT Been Stopped or Placed in a WAIT State!")
  1. ;
  1. LINH ; Check to see if Logons are Inhibited
  1. D GETENV^%ZOSV ; $P(Y,"^",2) = Installing Volume
  1. S X=+$G(^%ZIS(14.5,"LOGON",$P(Y,"^",2)))
  1. I 'X D
  1. . W $C(7)
  1. . D BMES^XPDUTL("* Warning Logons are NOT Inhibited!")
  1. Q