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

XPDIST.m

Go to the documentation of this file.
  1. XPDIST ;SFISC/RSD - site tracking ;03/05/2008
  1. ;;8.0;KERNEL;**66,108,185,233,350,393,486,539,547,672**;Jul 10, 1995;Build 28
  1. ;Per VHA Directive 2004-038, this routine should not be modified.
  1. ;Returns ""=failed, XMZ=sent
  1. ;D0=ien in file 9.7, XPY=national site tracking^address(optional)
  1. EN(D0,XPY) ;EF. send message
  1. N %,DIFROM,XPD,XPD0,XPD1,XPD2,XPDV,XPZ,X,X1,Z,Y,XPD6,XPDTRACK
  1. ;Get data needed
  1. I '$D(^XPD(9.7,$G(D0),0)) D BMES^XPDUTL(" INSTALL file entry missing") Q ""
  1. ;p350 -add node 6 for the Test# and Seq#. -REM
  1. S XPD0=^XPD(9.7,D0,0),XPD1=$G(^(1)),XPD2=$G(^(2)),XPD6=$G(^(6))
  1. I '$P(XPD0,U,2) D BMES^XPDUTL(" No link to PACKAGE file") Q ""
  1. S XPD=$P($G(^DIC(9.4,+$P(XPD0,U,2),0)),U),XPDV=$$VER^XPDUTL($P(XPD0,U))
  1. I XPD="" D BMES^XPDUTL(" PACKAGE file entry missing") Q ""
  1. ;XPZ(1)=start, XPZ(2)=completion date/time, XPZ(3)=run time
  1. S XPZ(1)=$P(XPD1,U),XPZ(2)=$P(XPD1,U,3),XPZ(3)=$$FMDIFF^XLFDT(XPZ(2),XPZ(1),3),XPZ(1)=$$FMTE^XLFDT(XPZ(1)),XPZ(2)=$$FMTE^XLFDT(XPZ(2))
  1. D LOCAL
  1. S XPDTRACK=$$TRACK
  1. D REMEDY ;p350 -REM
  1. Q $$FORUM()
  1. LOCAL ;Send a message to local mail group
  1. N XMY,XPDTEXT,XMTEXT,XMDUZ,XMSUB,XMZ,XMMG
  1. K ^TMP($J)
  1. S X=$$MAILGRP^XPDUTL(XPD) Q:X=""
  1. S XMY(X)="" D GETENV^%ZOSV
  1. ;Message for users
  1. S XPDTEXT(1,0)="PACKAGE INSTALL"
  1. S XPDTEXT(2,0)="SITE: "_$G(^XMB("NETNAME"))
  1. S XPDTEXT(3,0)="PACKAGE: "_XPD
  1. S XPDTEXT(4,0)="VERSION: "_XPDV
  1. S XPDTEXT(5,0)="Start time: "_XPZ(1)
  1. S XPDTEXT(6,0)="Completion time: "_XPZ(2)
  1. S XPDTEXT(7,0)="Environment: "_Y
  1. S XPDTEXT(8,0)="Installed by: "_$P($G(^VA(200,+$P(XPD0,U,11),0)),U)
  1. S XPDTEXT(9,0)="Install Name: "_$P(XPD0,U)
  1. S XPDTEXT(10,0)="Distribution Date: "_$$FMTE^XLFDT($P(XPD1,U,4))
  1. S XMDUZ=$S($P(XPD0,U,11):+$P(XPD0,U,11),1:.5),XMTEXT="XPDTEXT(",XMSUB=$P(XPD0,U)_" INSTALLATION"
  1. D ^XMD
  1. Q
  1. TRACK() ;EF. Should VA track the installation of this patch at a national level?
  1. Q:$G(XPY)="" 0 ; No - National site tracking was not requested
  1. ;Quit if not VA production primary domain
  1. I $G(^XMB("NETNAME"))'[".DOMAIN.EXT" D BMES^XPDUTL(" Not a VA primary domain") Q 0
  1. ;X ^%ZOSF("UCI") S %=^%ZOSF("PROD")
  1. ;S:%'["," Y=$P(Y,",")
  1. ;I Y'=% D BMES^XPDUTL(" Not a production UCI") Q ""
  1. ; 486/GMB Replaced the above 3 lines with the following line:
  1. I '$$PROD^XUPROD D BMES^XPDUTL(" Not a production UCI") Q 0
  1. Q 1
  1. REMEDY ;Send to Remedy Server - ESSRESOURCE@DOMAIN.EXT *p350 -REM
  1. Q:'XPDTRACK
  1. N XMY,XPDTEXT,XMTEXT,XMDUZ,XMSUB,XMZ,XMMG
  1. K ^TMP($J)
  1. S:XPY XMY("ESSRESOURCE@DOMAIN.EXT")=""
  1. S:$L($P(XPY,U,2)) XMY($P(XPY,U,2))=""
  1. ;Message for server (all in one string)
  1. ;XMTEXT=Type(1),Domain(2-65),Pkg(66-95),Version(96-125),
  1. ; StartTime(126-147),CompleteTime(148-169),RunTime(170-177),
  1. ; Date(178-199),InstalledBy(200-229),InstallName(230-259),
  1. ; DistributionDate(260-281),Seq#(282-286),
  1. ; PatchTestVersion(287-317)
  1. ;
  1. S X1=1_$G(^XMB("NETNAME")) ;Type is always "1"(1=patch,0=pkg).
  1. S $E(X1,66,95)=XPD,$E(X1,96,125)=XPDV,$E(X1,126,147)=XPZ(1),$E(X1,148,169)=XPZ(2),$E(X1,170,177)=XPZ(3),$E(X1,178,199)=DT
  1. S $E(X1,200,229)=$P($G(^VA(200,+$P(XPD0,U,11),0)),U),$E(X1,230,259)=$P(XPD0,U),$E(X1,260,281)=$P(XPD1,U,4),$E(X1,282,286)=$P(XPD6,U,2),$E(X1,287,317)=$P(XPD6,U)
  1. S XPDTEXT(1,0)=X1
  1. S XMDUZ=$S($P(XPD0,U,11):+$P(XPD0,U,11),1:.5),XMTEXT="XPDTEXT(",XMSUB="KIDS-"_$P(XPD0,U)_" INSTALLATION"
  1. D ^XMD
  1. Q
  1. FORUM() ;EF. send to Server on FORUM
  1. Q:'XPDTRACK ""
  1. N XMY,XPDTEXT,XMTEXT,XMDUZ,XMSUB,XMZ,XMMG
  1. K ^TMP($J)
  1. S:XPY XMY("S.A5CSTS@DOMAIN.EXT")=""
  1. S:$L($P(XPY,U,2)) XMY($P(XPY,U,2))=""
  1. ;Message for server
  1. S XPDTEXT(1,0)="PACKAGE INSTALL"
  1. S XPDTEXT(2,0)="SITE: "_$G(^XMB("NETNAME"))
  1. S XPDTEXT(3,0)="PACKAGE: "_XPD
  1. S XPDTEXT(4,0)="VERSION: "_XPDV
  1. S XPDTEXT(5,0)="Start time: "_XPZ(1)
  1. S XPDTEXT(6,0)="Completion time: "_XPZ(2)
  1. S XPDTEXT(7,0)="Run time: "_XPZ(3)
  1. S XPDTEXT(8,0)="DATE: "_DT
  1. S XPDTEXT(9,0)="Installed by: "_$P($G(^VA(200,+$P(XPD0,U,11),0)),U)
  1. S XPDTEXT(10,0)="Install Name: "_$P(XPD0,U)
  1. S XPDTEXT(11,0)="Distribution Date: "_$P(XPD1,U,4)
  1. S XPDTEXT(12,0)=XPD2
  1. S XPDTEXT(13,0)=+XPD6
  1. S XMDUZ=$S($P(XPD0,U,11):+$P(XPD0,U,11),1:.5),XMTEXT="XPDTEXT(",XMSUB=$P(XPD0,U)_" INSTALLATION"
  1. D ^XMD
  1. Q "#"_$G(XMZ)
  1. ;
  1. CHKS(XPDPH,XPDTEXT) ;Get Checksum from Forum for patch XPDPH, XPDTEXT is passed by reference
  1. ;returns XPDTEXT(routine name)= before checksum
  1. ;need to create parameter to store url - future
  1. Q
  1. K ^TMP($J,"XPDTHC")
  1. Q:$G(XPDPH)=""
  1. N XPDCHK,XPDHDR,XPDURL,I,X,Y
  1. S XPDURL="http://127.0.0.1:6100/cgi/PCHCSUM?PCH="_XPDPH,XPDCHK=0
  1. S X=$$GETURL^XTHC10(XPDURL,,$NA(^TMP($J,"XPDTHC")),.XPDHDR)
  1. I X>0 D
  1. . S I=""
  1. . F S I=$O(^TMP($J,"XPDTHC",I)) Q:I="" S X=$G(^(I)) D:$E(X,1,4)="<li>"
  1. .. S Y=$P($P(X,"</li>"),U,4),X=$P($P(X,"<li>",2),U),XPDTEXT(X)=Y,XPDCHK=XPDCHK+1
  1. . Q
  1. S XPDTEXT=XPDCHK
  1. K ^TMP($J,"XPDTHC")
  1. Q