Skip to main content

HS.Util.Installer.Upgrade.Abstract

abstract class HS.Util.Installer.Upgrade.Abstract extends %Library.RegisteredObject

Base class for classes to extend to add upgrade steps for specific versions. Each subclass should be of the form PackageName.V[Version number] e.g. MyBase.Package.V1. Upgrade steps are run sequentially by version number in ascending order across upgrade classes.
There are many types of upgrade steps that can be run as described below. Any methods in a subclass of this class that doesn't match the upgrade step naming convention is ignored (for example, utility methods). Upgrad methods are also run sequentially by the trailing number in the method name. e.g. Method1, Method2, ... , MethodN etc. are run in order 1...N.

To have code execute after the production startup, use the $$$OnStartStep macro in HS.Upgrade to queue a class method to run in the background. The method MUST return a status code.

Upgrade is a generic upgrade step for HealthShare namespaces outside of hscore i.e. not in HSLIB
  ClassMethod UpgradeStep1() as %Status {
  	///Do some work
  	Quit $$$OK
  }
  ClassMethod UpgradeStep2() as %Status {
  	///Do some additional work
  	Quit $$$OK
  }
  
Core is for security or system level tasks for the entire HealthShare instance. Runs only from HSSYS
  ClassMethod CoreStep1() as %Status {
  	///Do some work
  	Quit $$$OK
  }
  ClassMethod CoreStep2() as %Status {
  	///Do some additional work
  	Quit $$$OK
  }
  
For any namespace type i.e. the value of the Type property of a subclass of HS.Util.Installer.ConfigItem, upgrade steps can be run as [Namespace type]Step[Increment]. For example, upgrade steps for a hub namespace can be HubStep1, HubStep2, HubStep3 etc.
  ClassMethod HubStep1() as %Status {
  	///Do some work
  	Quit $$$OK
  }
  

Method Inventory

Methods

classmethod AddConfigItem(pFromProd As Ens.Config.Production, pItemClassName, pToProd As Ens.Config.Production, pItemConfigName As %String = "") as %Status
Call this to copy config item pItemClassName from sample production pFromProd to exisitng production pToProd This does not save pToProd pItemConfigName is optional, to support using the same class name in more than one config item.
classmethod AddItemSetting(pProd As Ens.Config.Production, pItemClassName As %String, pSettingName As %String, pSettingValue As %String, pTarget As %String) as %Status
Add setting pSetting on item pItemClassName in production oref pProd, with target pTarget and
classmethod AddItemSettingByName(pProd As Ens.Config.Production, pItemName As %String, pSettingName As %String, pSettingValue As %String, pTarget As %String) as %Status
Add setting pSetting on item pItemName in production oref pProd, with target pTarget and
classmethod AddProductionSetting(pProd As Ens.Config.Production, pSettingName As %String, pSettingValue As %String) as %Status
Add a setting to pProd (oref)
classmethod AsyncOperationComplete(pQnum)
Close a successfully processed AsyncOpQ entry
classmethod ConfigItemExists(pProd As Ens.Config.Production, pItemClassName As %String) as %Boolean
Check to see if a config item with the specified class name exists in the production.
classmethod GetAsyncOperation(Output pOpDispatchName, Output pRequest As Ens.Request, Output pQnum) as %Status
Get the next AsyncOpQ entry (if any), and return its dispatchname and opened message with its sequence number in pQnum
classmethod GetItemSetting(pProd As Ens.Config.Production, pItemClassName As %String, pSettingName As %String, Output pSettingValue As %String) as %Status
Find the value of setting pSetting on item pItemClassName in production oref pProd
classmethod InvokeAsyncOperation(pOpDispatchName, pRequest As Ens.Request, Output pQnum) as %Status
Put an entry in the AsyncOpQ in ^HS.Upgrade. HS.Util.MaintenanceService will run at intervals set by the production (default = 60 secs) and will submit up to 200 of these requests for processing ^HS.Upgrade("AsyncOpQ",n)=dispatchname,messageclass,messageid
classmethod LayoutUpgrade(ByRef pLogFile As %File) as %Status
classmethod MergeConfigItems(pNamespace As %String, pFromName As %String, pToName As %String) as %Status
Add configuration items from one production into an existing production, and save the new production
classmethod OpenCurrentProduction(Output pProdRef As Ens.Config.Production) as %Status
Call this to open the current production in order to modify it
classmethod OpenProduction(pProdClass As %String, Output pProdRef As Ens.Config.Production) as %Status
Call this to open a sample production in order to copy config items and settings from it
classmethod RemoveConfigItem(pFromProd As Ens.Config.Production, pItemClassName) as %Status
Call this to copy config item pItemClassName from sample production pFromProd to exisitng production pToProd This does not save pToProd
classmethod SaveProduction(pProd As Ens.Config.Production) as %Status
Save pProd (oRef)
classmethod SetItemProperty(pProd As Ens.Config.Production, pItemName As %String, pName As %String, pValue As %String) as %Status
Set ConfigItem property to a specified value pProd: Prod ref pItemName: Config item name pName: Property name pValue: Property value
classmethod SetItemSetting(pProd As Ens.Config.Production, pItemClassName As %String, pSettingName As %String, pSettingValue As %String) as %Status
Update the value of setting pSetting on item pItemClassName in production oref pProd

Inherited Members

Inherited Methods

Subclasses

FeedbackOpens in a new tab