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

EC2P119.m

Go to the documentation of this file.
  1. EC2P119 ;ALB/DAN Update DSS names to uppercase ;1/14/13 11:27
  1. ;;2.0;EVENT CAPTURE;**119**;8 May 96;Build 12
  1. POST ;Post install runs from here
  1. N DSSID,NAME,UPNAME,DATA,DUP,UPD,ERR,CNT
  1. D BMES^XPDUTL("Checking DSS UNIT names for lowercase letters")
  1. D CHECK
  1. D BMES^XPDUTL("Sending email to installer and holders of ECMGR key with results of check")
  1. D MAIL
  1. Q
  1. ;
  1. CHECK ;Check existing DSS UNIT entries in file 724 for names that have lowercase letters. Convert to uppercase if found.
  1. S DSSID=0 F S DSSID=$O(^ECD(DSSID)) Q:'+DSSID D
  1. .S NAME=$P(^ECD(DSSID,0),U),UPNAME=$$UP^XLFSTR(NAME)
  1. .I NAME=UPNAME Q ;Nothing to change
  1. .I $D(^ECD("B",UPNAME)) S DUP(NAME)=UPNAME Q ;Converting name would cause a duplicate
  1. .S DATA(724,DSSID_",",".01")=UPNAME D FILE^DIE(,"DATA") ;file change in name
  1. .I '$D(^TMP("DIERR",$J)) S UPD(NAME)=UPNAME Q ;Uppercase name stored without error
  1. .S ERR(NAME)="" K ^TMP("DIERR",$J) Q ;Error filing name.
  1. Q
  1. ;
  1. MAIL ;Send email with results
  1. N XMSUB,ECTEXT,XMDUZ,XMY,XMZ,XMTEXT,KIEN,DIFROM
  1. S XMDUZ="Event Capture Patch 119 Post-install"
  1. S XMY($G(DUZ,.5))="" ;Set recipient to installer or postmaster
  1. S KIEN=0 F S KIEN=$O(^XUSEC("ECMGR",KIEN)) Q:'+KIEN S XMY(KIEN)="" ;Holders of ECMGR included in email, XUSEC read allowed by DBIA #10076
  1. S XMSUB="Patch EC*2*119 Post install COMPLETED"
  1. S XMTEXT="ECTEXT("
  1. S ECTEXT(1)="The post-install for patch 119, review of DSS UNIT names,"
  1. S ECTEXT(2)="has completed. Below are the results of the review."
  1. S ECTEXT(3)=""
  1. I '$D(DUP)&('$D(UPD))&('$D(ERR)) S ECTEXT(4)="No changes were made and no further action is required." D ^XMD Q
  1. S CNT=4
  1. I $D(UPD) D S ECTEXT(CNT)="",CNT=CNT+1
  1. .S ECTEXT(CNT)="The following entries were updated during this process.",CNT=CNT+1,ECTEXT(CNT)="No further action is required for these entries.",CNT=CNT+1,ECTEXT(CNT)="",CNT=CNT+1
  1. .S NAME="" F S NAME=$O(UPD(NAME)) Q:NAME="" S ECTEXT(CNT)=NAME_" was changed to "_UPD(NAME),CNT=CNT+1
  1. I $D(DUP) D S ECTEXT(CNT)="",CNT=CNT+1
  1. .S ECTEXT(CNT)="The following entries could not be updated because a duplicate entry",CNT=CNT+1,ECTEXT(CNT)="would have been created. Please update entries manually or log a remedy",CNT=CNT+1,ECTEXT(CNT)="ticket for assistance.",CNT=CNT+1
  1. .S ECTEXT(CNT)="",CNT=CNT+1
  1. .S NAME="" F S NAME=$O(DUP(NAME)) Q:NAME="" S ECTEXT(CNT)=NAME_" would have created a duplicate entry to "_DUP(NAME),CNT=CNT+1
  1. I $D(ERR) D
  1. .S ECTEXT(CNT)="The following entries couldn't be updated because an error was encountered.",CNT=CNT+1,ECTEXT(CNT)="Please log a remedy ticket for assistance.",CNT=CNT+1,ECTEXT(CNT)="",CNT=CNT+1
  1. .S NAME="" F S NAME=$O(ERR(NAME)) Q:NAME="" S ECTEXT(CNT)="Couldn't update DSS UNIT "_NAME,CNT=CNT+1
  1. D ^XMD