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

MAGIP108.m

Go to the documentation of this file.
  1. MAGIP108 ;WOIFO/NST - INSTALL CODE FOR MAG*3.0*108 ; 15 Apr 2010 2:53 PM
  1. ;;3.0;IMAGING;**108**;Mar 19, 2002;Build 1738;May 20, 2010
  1. ;; Per VHA Directive 2004-038, this routine should not be modified.
  1. ;; +---------------------------------------------------------------+
  1. ;; | Property of the US Government. |
  1. ;; | No permission to copy or redistribute this software is given. |
  1. ;; | Use of unreleased versions of this software requires the user |
  1. ;; | to execute a written test agreement with the VistA Imaging |
  1. ;; | Development Office of the Department of Veterans Affairs, |
  1. ;; | telephone (301) 734-0100. |
  1. ;; | The Food and Drug Administration classifies this software as |
  1. ;; | a medical device. As such, it may not be changed in any way. |
  1. ;; | Modifications to this software may result in an adulterated |
  1. ;; | medical device under 21CFR820, the use of which is considered |
  1. ;; | to be a violation of US Federal Statutes. |
  1. ;; +---------------------------------------------------------------+
  1. ;;
  1. ; There are no environment checks here but the MAGIP108 has to be
  1. ; referenced by the "Environment Check Routine" field of the KIDS
  1. ; build so that entry points of the routine are available to the
  1. ; KIDS during all installation phases.
  1. Q
  1. PRE ;
  1. Q
  1. ;
  1. POS ;
  1. D ADDRPC() ; Link new remote procedures to the Broker context option
  1. D RPTSKCP() ; Restart the Imaging Utilization Report task
  1. D NOTIFY() ; Send the notification e-mail
  1. Q
  1. ;
  1. ADDRPC() ;
  1. N RPCNAMES,NAME,RPCIEN,IENS,OPTIEN,I,GET,DIERR,MAGFDA
  1. ; 1. Add RPCs to Secondary menu(s)
  1. ;
  1. S OPTIEN=$$LKOPT^XPDMENU("MAG WINDOWS")
  1. I OPTIEN'>0 W !,"Error getting ""MAG WINDOWS"" context" Q
  1. ;
  1. S RPCNAMES="RPCLST^"_$T(+0)
  1. ;--- Get the list from the source code
  1. S GET=$P(RPCNAMES,"^")_"+I^"_$P(RPCNAMES,"^",2)
  1. S GET="S NAME=$$TRIM^XLFSTR($P($T("_GET_"),"";;"",2))"
  1. F I=1:1 X GET Q:NAME="" S RPCNAMES(NAME)=""
  1. ;
  1. S NAME=""
  1. F S NAME=$O(RPCNAMES(NAME)) Q:NAME="" D
  1. . ;--- Check if the remote procedure exists
  1. . S RPCIEN=$$FIND1^DIC(8994,,,NAME,"B",,"MAGMSG")
  1. . I $G(DIERR) Q
  1. . I RPCIEN'>0 Q
  1. . ;--- Add the remote procedure to the multiple
  1. . S IENS="?+1,"_OPTIEN_","
  1. . S MAGFDA(19.05,IENS,.01)=RPCIEN
  1. . D UPDATE^DIE(,"MAGFDA",,"MAGMSG")
  1. . I $G(DIERR) W !,"Error updating ""MAG WINDOWS"" context RPC="_NAME
  1. . ;---
  1. . Q
  1. Q
  1. ;
  1. NOTIFY() ;
  1. N CNT,CT,IENS,MAGBUF,MAGERR,MAGMSG,MAGRC,ST,Y
  1. S MAGRC=0,IENS=XPDA_","
  1. ;
  1. ;--- Load the build properties from the BUILD file (#9.7)
  1. D GETS^DIQ(9.7,IENS,".01;6;9;11;17;51","EI","MAGBUF","MAGERR")
  1. I $G(DIERR) W !,"Error loading the build properties" Q
  1. ;
  1. ;--- Compile the message text
  1. S CNT=0
  1. S CNT=CNT+1,MAGMSG(CNT)="PACKAGE INSTALL"
  1. S CNT=CNT+1,MAGMSG(CNT)="SITE: "_$$KSP^XUPARAM("WHERE")
  1. S CNT=CNT+1,MAGMSG(CNT)="PACKAGE: "_XPDNM
  1. S CNT=CNT+1,MAGMSG(CNT)="Version: "_$$VER^XPDUTL(XPDNM)
  1. S ST=$G(MAGBUF(9.7,IENS,11,"I"))
  1. S CNT=CNT+1,MAGMSG(CNT)="Start time: "_$$FMTE^XLFDT(ST)
  1. S CT=$G(MAGBUF(9.7,IENS,17,"I")) S:+CT'=CT CT=$$NOW^XLFDT()
  1. S CNT=CNT+1,MAGMSG(CNT)="Completion time: "_$$FMTE^XLFDT(CT)
  1. S CNT=CNT+1,MAGMSG(CNT)="Run time: "_$$FMDIFF^XLFDT(CT,ST,3)
  1. D GETENV^%ZOSV
  1. S CNT=CNT+1,MAGMSG(CNT)="Environment: "_Y
  1. S CNT=CNT+1,MAGMSG(CNT)="FILE COMMENT: "_$G(MAGBUF(9.7,IENS,6,"I"))
  1. S CNT=CNT+1,MAGMSG(CNT)="DATE: "_$$NOW^XLFDT()
  1. S CNT=CNT+1,MAGMSG(CNT)="Installed by: "_$G(MAGBUF(9.7,IENS,9,"E"))
  1. S CNT=CNT+1,MAGMSG(CNT)="Install Name: "_$G(MAGBUF(9.7,IENS,.01,"E"))
  1. S Y=$G(MAGBUF(9.7,IENS,51,"E"))
  1. S CNT=CNT+1,MAGMSG(CNT)="Distribution Date: "_Y
  1. ;
  1. ;--- Send the e-mail notification
  1. D
  1. . N DIFROM,XMERR,XMID,XMSUB,XMY,XMZ
  1. . S XMSUB=$E(XPDNM_" INSTALLATION",1,63)
  1. . S XMID=$G(DUZ) S:XMID'>0 XMID=.5
  1. . S (XMY(XMID),XMY("G.MAG SERVER"))=""
  1. . D SENDMSG^XMXAPI(XMID,XMSUB,"MAGMSG",.XMY,,.XMZ)
  1. . Q:'$G(XMERR)
  1. . K MAGERR M MAGERR=^TMP("XMERR",$J)
  1. . Q
  1. ;
  1. ;---
  1. Q
  1. ;
  1. ;+++++ LIST OF NEW REMOTE PROCEDURES
  1. RPCLST ;
  1. ;;MAG4 INDEX GET ORIGIN
  1. ;;MAGN PATIENT HAS PHOTO
  1. Q 0
  1. ;
  1. ;+++++ RESTARTS THE IMAGING UTILIZATION REPORT TASK
  1. RPTSKCP() ;
  1. D REMTASK^MAGQE4,STTASK^MAGQE4
  1. Q 0