Skip to main content

HS.Util.Installer.ConfigItem

persistent class HS.Util.Installer.ConfigItem extends %Library.Persistent, %XML.Adaptor, HS.Util.DataModel.Adaptor, HS.HC.ClientAPI.InstanceConfig.NamespaceInfo, HS.Util.Installer.AbstractConfigItemType

SQL Table Name: HS_Util_Installer.ConfigItem

A HealthShare configuration item.

Property Inventory

Method Inventory

Parameters

parameter %JSONENABLED = 1;
Inheritence = Right does not seem to work so force JSON enabling.
parameter %JSONIGNORENULL = 1;
So that field input in JSON as empty string will be handled correctly
parameter CODEDATABASE = HSLIB;
Used in components to define the code database name where to locate sample templates
parameter DOMAIN = HS;
Use the "HS" domain for localization.
parameter RESOURCE;
Inherited description: If specified, this RESOURCE:PERMISSION is checked before any operation on this class via Zen MVC. (Create, Read, Update, or Delete.)
parameter SAMPLETEMPLATES;
Where to locate the sample template definitions, ie Hub HS.Sample.Production.Hub (to get all items under that package)
parameter UITIER = 10;
Parameter that controls the relative importance of this component type in the HealthShare Home UI for selecting namespaces. Lower values indicate components that should appear earlier in the UI. The value is used as the default return value for the GetConfigTypeUITier()() helper method.
parameter VALIDATETEMPLATES = 1;
Whether to validate SAMPLETEMPLATES (default to yes)
parameter XMLIGNOREINVALIDTAG = 1;
Inherited description: The XMLIGNOREINVALIDTAG parameter allows the programmer to control handling of unexpected elements in the XML input. The XMLIGNOREINVALIDTAG parameter will only take affect if XMLSEQUENCE = 0 (the default). By default (XMLIGNOREINVALIDTAG = 0), will treat an unexpected element as an error. If XMLIGNOREINVALIDTAG is set = 1 and XMLSEQUENCE = 0, then unexpected elements will be ignored.
parameter XMLIGNORENULL = inputonly;
Inherited description: XMLIGNORENULL allows the programmer to override the default XML handling of empty strings for properties of type %String. By default (XMLIGNORENULL = 0), empty strings in the XML input are stored as $c(0) and $c(0) is written to XML as an empty tag. A missing tag in the XML input is always stored as "" and "" is always output to XML as no tag.

If XMLIGNORENULL is set = 1, then both missing tags in the XML and empty strings are input as "", and both "" and $c(0) are output as empty tags (i.e. <tag></tag>).

If XMLIGNORENULL is set = "inputonly", then both missing tags in the XML and empty strings are input as "". Output of "" and $c(0) are for XMLIGNORENULL = 0: $c(0) is output as an empty tag (i.e. <tag></tag>) and "" is output as no tag.

If XMLIGNORENULL = "runtime" (runtime is not case sensitive), then the behavior of XMLIGNORENULL is determined by the format parameter of XMLExport, XMLImport and %XML.Reader.OpenFile. The default behavior for XMLIGNORENULL="runtime is the same as XMLIGNORENULL=0. Adding "ignorenull" to the format argument changes the behavior to that of XMLIGNORENULL=1. "ignorenull" shoud be separated by a comma from literal/encoded part of the format. Example values for format are "", ",ignorenull", "literal,ignorenull" and "encoded,ignorenull". Note that "inputonly" is equivalent to using ,ignorenull for XMLExport and not for %XML.Reader.

Properties

deprecated property %HSLIB as %String (%JSONINCLUDE = "NONE") [ InitialExpression = "HSLIB" , Required ];
No JSON projection since this is always set to the initial expression of HSLIB.
Property methods: %HSLIBDisplayToLogical(), %HSLIBGet(), %HSLIBGetStored(), %HSLIBIsValid(), %HSLIBLogicalToDisplay(), %HSLIBLogicalToOdbc(), %HSLIBNormalize(), %HSLIBSet()
property Activated as %Boolean (%JSONINCLUDE = "OUTPUTONLY") [ InitialExpression = 0 ];
Overriding for JSON handling. Only as output since property should be set only by namespace activation.
TODO: Use custom JSON Mapping XData blocks for NamespaceInfo subclasses in future.
Property methods: ActivatedDisplayToLogical(), ActivatedGet(), ActivatedGetStored(), ActivatedIsValid(), ActivatedLogicalToDisplay(), ActivatedLogicalToXSD(), ActivatedNormalize(), ActivatedSet(), ActivatedXSDToLogical()
property AdditionalConfigParams as array of HS.HC.InstanceConfig.Storage.AdditionalConfigParam;
Additional config parameters. Overriding to use persistent class.
Property methods: AdditionalConfigParamsBuildValueArray(), AdditionalConfigParamsCollectionToDisplay(), AdditionalConfigParamsCollectionToOdbc(), AdditionalConfigParamsDisplayToCollection(), AdditionalConfigParamsGet(), AdditionalConfigParamsGetObject(), AdditionalConfigParamsGetObjectId(), AdditionalConfigParamsGetStored(), AdditionalConfigParamsGetSwizzled(), AdditionalConfigParamsIsValid(), AdditionalConfigParamsOdbcToCollection(), AdditionalConfigParamsSet(), AdditionalConfigParamsSetObject(), AdditionalConfigParamsSetObjectId()
property CreatedAt as %TimeStamp (%JSONINCLUDE = "OUTPUTONLY") [ InitialExpression = ##class(%UTC).NowLocal() , Required ];
Overriding to mark as required + JSON handling.
Property methods: CreatedAtDisplayToLogical(), CreatedAtGet(), CreatedAtGetStored(), CreatedAtIsValid(), CreatedAtLogicalToDisplay(), CreatedAtLogicalToXSD(), CreatedAtNormalize(), CreatedAtOdbcToLogical(), CreatedAtSet(), CreatedAtXSDToLogical()
property LastActivated as %TimeStamp (%JSONINCLUDE = "OUTPUTONLY");
Overriding for JSON handling. Only as output since property should be set only by namespace activation.
TODO: Use custom JSON Mapping XData blocks for NamespaceInfo subclasses in future.
Property methods: LastActivatedDisplayToLogical(), LastActivatedGet(), LastActivatedGetStored(), LastActivatedIsValid(), LastActivatedLogicalToDisplay(), LastActivatedLogicalToXSD(), LastActivatedNormalize(), LastActivatedOdbcToLogical(), LastActivatedSet(), LastActivatedXSDToLogical()
property Name as HS.HC.DataType.NamespaceName [ Required ];
Overriding to mark as required.
Property methods: NameDisplayToLogical(), NameGet(), NameGetStored(), NameIsValid(), NameLogicalToDisplay(), NameLogicalToOdbc(), NameNormalize(), NameSet()
property Type as HS.HC.DataType.NamespaceType [ InitialExpression = ..#TYPE , Required ];
Overriding to mark as required.
Property methods: TypeGet(), TypeGetStored(), TypeLogicalToOdbc(), TypeNormalize(), TypeSet()

Methods

classmethod AddDeferredAction(pNamespace As %String, actionName As %String, value As %List)
Saves Marker handled by OnProductionStart handler to perform actions that require a running Production
classmethod BuildPortalApp(pNamespace, ByRef pLogFile, pAddRoles As %String = "") as %Status
Build CSP application
classmethod CSPPath(pNamespace) as %String
classmethod ClearDeferredActions(pNamespace)
classmethod ClearFHIRDbs(pDBList As %List, pLogFile, pPurge) as %Status
classmethod CopyFilesFromInstallDirToDataDir(pSourceRelativePath As %String, pTargetRelativePath As %String) as %String
Copy files from provided source path (relative to the installation directory) to provided target target path (relative to data directory).
Files are overlaid.
IS NOT MIRROR AWARE. This is intentional. This method is intended for use during an operation that happens on both members of a mirror (such as production start).
@Argument pSourceRelativePath Source path (should be relative. Not absolute).
@Argument pTargetRelativePath Target path (should be relative. Not absolute).
classmethod CreateProjectionsForRESTModelClasses(pTargetNamespace As %String = $Namespace, pSourceNamespace As %String = "HSLIB", pKillTargetBeforeMerge As %Boolean = 1)
Helper method to transfer all persistent data (created by projections) from a source namespace to a target one.
classmethod DeleteHSAUDIT() as %Status
classmethod ExistsNS(pNamespace) as %Boolean
classmethod GetComponentByName(pName As %String, Output pComponent As HS.Util.Installer.ConfigItem, pCreate As %Boolean = 0, pType As %String = "", pHSLIB As %String = "HSLIB", ByRef pVars) as %Status
Open the configuration object pComponent with name pName If it does not exist (and pCreate is set) then create an object of the specified type, using any Settings provided and some (but not all) defaults pHSLIB argument is not used - it's an ancient leftover
classmethod GetDBDirs(pDBList As %List, ByRef pArr)
classmethod GetDBResourceName(pNamespace As %String = "", ByRef tSC=$$$OK) as %String
classmethod GetDefaultCSPCustomLoginPage() as %String
Helper method to return the default CSP Custom Login page that should be added to user-facing CSP applications for this ConfigItem type.
classmethod GetDefaultCSPCustomLoginPageForNamespace(pNamespace As %String) as %String
Helper method to return the default CSP Custom Login page for a given namespace.
classmethod GetDefaultCSPSessionEventsClass() as %String
Helper method to return the default CSP SessionEvents class that should be added to user-facing CSP applications for this ConfigItem type.
classmethod GetDefaultCSPSessionEventsClassForNamespace(pNamespace As %String) as %String
Helper method to return the default CSP SessionEvents class for a given namespace.
classmethod GetDeferredAction(pNamespace As %String, actionName As %String) as %List
method GetPackageName() as %String
method GetProductionName() as %String
classmethod GetPropertyValue(pID="", pPropertyName As %String = "", Output pSC As %Status) as %String
The GetStored method of properties in persistent classes is designed (and documented) to return an error if the referenced object instance does not exist. This method works around that by returning "" in that case.
classmethod GetSampleTemplates(Output pSampleProductions) as %Status
classmethod GetThisComponentName() as %String
This can be called from a running production to get the component name. By Default, the component name is the same as the namespace. In 2008.1, this was only sort-of findable, on edge gateways, as a setting on HS.Gateway.HSWS.WebServices Starting with 2008.2, there's a setting on the sample productions where this will really live.
classmethod GetUIMenuClass(pInternalProductName As %String) as %Dictionary.Classname
Helper method to allow sub-classes to specify an alternative class to drive the population of the UI menus for this namespace type. The menu class should extend HS.HC.Util.AbstractUIMenuClass and SHOULD implement the addMenu() method.
classmethod GetUpgradeClassPrefix(pInternalProductName As %String) as %String
Helper method to identify the prefix that should be used to locate the upgrade classes for the specified product. Note that the classes must extend HS.Util.Installer.Upgrade.Abstract, and have numeric trailing values that match major version releases.
method HSComponentNameGet() as %String
classmethod HasDeferredActions(pNamespace As %String)
abstract classmethod Install(pNamespace As %String, ByRef pVars) as %Status
Install the configuration item in the specified namespace. pVars allows you to override/change configuration parameters, which will be updated in the HS.Util.Installer.ConfigItem database. The allowed subscripts in pVars will vary across the different subclasses of HS.Util.Installer.ConfigItem, and the method should be overridden and re-documented in each subclass.
method MarkActivated(pValue As %Boolean = 1) as %Status
Mark this config item as being activated Also saves any changed values
classmethod MergeGlobal(pGlobalName As %String, pSource As %String, pTarget As %String, pKillTargetBeforeMerge As %Boolean = 1)
classmethod OnPreUnInstall(pNamespace As %String, pPurgeFiles As %Boolean = 0, pLogFile) as %Status
classmethod OnUnInstall(pNamespace As %String, pPurgeFiles As %Boolean = 0, pLogFile) as %Status
Can be implemented on subclasses that aren't overriding UnInstall
classmethod OnUnInstallCleanup()
Invoked before final cleanup of HSSYS occurs when no records left of HS.Util.Installer.ConfigItem. @API.Overrideable
classmethod SetThisComponentName(pHSName As %String) as %Status
classmethod SettingsFilePath(tDirPath)
Input a file directory path that is relative to the installation directory This outputs a path that we can use as an Ensemble setting, relative to the default process directory, assuming the default process' database directory is directly under (installdir)\mgr This allows an installdemo to be mirrored on the same laptop In production, the setting would always be changed to point to somewhere else, and if a mirror, it would need to be the same physical directory on both sides
classmethod StartProduction(pNamespace As %String, pProductionName As %String = "", ByRef pState As %Integer) as %Status
Try to start pProduction in pNamespace (if it is stopped) Result can be: failure, returns %Status success, returns pState=1 ($$$eProductionStateRunning) pState=2 ($$$eProductionStateStopped) pState=3 ($$$eProductionStateSuspended) pState=4 ($$$eProductionStateTroubled) pState=5 ($$$eProductionStateNetworkStopped)
classmethod StopProduction(pNamespace As %String, pTimeout As %Numeric = 30, ByRef pInitialState As %Integer, ByRef pState As %Integer, pForce As %Boolean = 0) as %Status
Try to stop the Production in pNamespace (if not already stopped) (we assume only one Production per namespace !) Result can be: failure, returns %Status success, returns pState=1 ($$$eProductionStateRunning) pState=2 ($$$eProductionStateStopped) pState=3 ($$$eProductionStateSuspended) pState=4 ($$$eProductionStateTroubled) pState=5 ($$$eProductionStateNetworkStopped)
classmethod UnInstall(pNamespace As %String, pPurgeFiles As %Boolean = 0, pDeleteCSPApps As %Boolean = 1) as %Status
Most callers will pass 1 to purgefiles This will attempt to clean up as much as possible, even if things are partially deleted
classmethod UnInstallCleanup()
On UnInstall, cleanup HSSYS if no other HS namespaces exist
classmethod UnInstallP(pNamespace As %String) as %Status
New wrapper for Uninstall - does purge. Subsequent reinstall will fail if IRIS.DAT is still present
classmethod ValidateName(pNamespace, ByRef pDatabase, ByRef pProduction) as %String

Queries

query Configuration()
SQL Query:
SELECT %ID,Name,Type,CreatedAt,Description,Production,Activated,LastActivated,Disabled FROM ConfigItem ORDER BY Type, Name
Enumerate all configuration items

Indexes

index (NameIdx on Name) [IdKey, Type = key, Unique];
Name index to ensure uniqueness
Index methods: NameIdxCheck(), NameIdxDelete(), NameIdxExists(), NameIdxOpen(), NameIdxSQLCheckUnique(), NameIdxSQLExists(), NameIdxSQLFindPKeyByConstraint(), NameIdxSQLFindRowIDByConstraint()

Triggers

trigger TemplateUpdateValidation (BEFORE event UPDATE);
Trigger to validate template not changing on update. By default trigger occurs before save so this validation will result in failure to save.
trigger TypeUpdateValidation (BEFORE event UPDATE);
Trigger to validate type not changing on update. By default trigger occurs before save so this validation will result in failure to save.

Inherited Members

Inherited Properties

Inherited Methods

Storage

Storage Model: Storage (HS.Util.Installer.ConfigItem)

^%SYS("HealthShare","Instances")(ID,"AdditionalConfigParams",n)
=
AdditionalConfigParams(n)

Storage Model: Storage (HS.Util.Installer.ConfigItem)

^%SYS("HealthShare","Instances")(ID)
=
%%CLASSNAME
CreatedAt
Template
Production
Activated
LastActivated
Description
Disabled
HSComponentName
Products
AuditProduction
DatabaseLocation

Storage Model: Storage (HS.Util.Installer.ConfigItem)

^%SYS("HealthShare","Instances")(ID,"HSLIB")
=
%HSLIB

Storage Model: Storage (HS.Util.Installer.ConfigItem)

^%SYS("HealthShare","Instances")(ID,"Type")
=
Type

Subclasses

FeedbackOpens in a new tab