Skip to main content

HS.Util.XSLTHelper

class HS.Util.XSLTHelper extends %XML.XSLT.CallbackHandler

This class handles callbacks from the XSLT processor. You should create a subclass this class and override the 'evaluate' method to perform the processing that you require. An example of an stylesheet using this function is shown in the example XSL contained in the %XML.XSLT.Transformer class

Method Inventory

Methods

classmethod ReportAccess()
classmethod ResetAccess()
classmethod createHL7Timestamp() as %String
classmethod createID(pPrefix As %String = "") as %String
Create a generic XML element ID unique for the current transform, with optional prefix
classmethod createOID() as %String
classmethod createUUID() as %String
classmethod dateDiff(pDatePart As %String = "", pStartDateODBCFormat As %String = "", pEndDateODBCFormat As %String = {$ZDateTime($Horolog, 3)}) as %Integer
classmethod dateNoDash(pDate) as %String
method evaluate(Args...) as %String
Inherited description: Evaluate receives a variable number of arguments, allowing you to pass multiple arguments on the evaluate call. The number of arguments is available in the Args variable and each value can be accessed by subscripting. The method has a single return value which will be returned as the result of the xslt evaluate function(). The return value can either be a regular cache variable or it can be an instance of a stream object. This allows for returning a value that is greater than 32k in size. The stream has to be wrapped in an instance of %XML.XSLT.StreamAdapter which facilitates the XSLT processors reading of the stream. This example shows both techniques, change the 1 to 0 to test the stream functionality (%XML.XSLT.Transformer.Example3() exercises this functionality)
classmethod getCodeForOID(pOID As %String = "", pType As %String = "", pDefault As %String = "") as %String
classmethod getCodeForURL(pURL As %String = "", pType As %String = "", pDefault As %String = "") as %String
classmethod getCodedEntryConfig(pCodeType As %String = "", Args...) as %String
Return the most specific coded entry XSL nodes for the given coded entry type as code^desc^scheme
classmethod getConfigValue(pKey As %String = "") as %String
Return a registry config value for the given key
classmethod getDescriptionForOID(pOID As %String = "", pType As %String = "", pDefault As %String = "") as %String
classmethod getDescriptionForURL(pURL As %String = "", pType As %String = "", pDefault As %String = "") as %String
classmethod getHierarchicalConfigValue(pKey As %String = "", Args...) as %String
Return the most specific registry config value for the given root and children For example here are some outputs given the following keys: \a = apple \a\b = banana \a\b\c = carrot \a\\c = cucumber getHierarchialConfigValue("\a",,,"b","c") -> carrot getHierarchialConfigValue("\a",,,"b") -> banana getHierarchialConfigValue("\a",,,"x","y") -> apple getHierarchialConfigValue("\a",,,"","c") -> cucumber This is used by the XDSb Document metadata generator transform to allow overriding coded entries (aka Classifications) based on context
classmethod getOIDForCode(pCode As %String = "", pType As %String = "", pDefault As %String = "") as %String
classmethod getPreviousUUID(pDocKey As %String = "") as %String
DEPRECATED -- This method is no longer supported by InterSystems and will be removed Return the UUID of the previous submission for the given document key, if any
classmethod getQuickStream(pStreamId) as %String
Method to return the contents of a quickstream. For security purposes, the stream ID must be one explictly labeled as one to be passed into here, starting with TXSLTHelper (perhaps followed by $J)
classmethod getServiceHostFromOID(pOID As %String = "", pOIDType As %String = "", pFunction As %String = "", pServiceType As %String = "") as %String
Return a registry service host given an oid
classmethod getServiceNameFromOID(pOID As %String = "", pOIDType As %String = "", pFunction As %String = "", pServiceType As %String = "") as %String
Return a registry service name given an oid
classmethod getServiceNameFromURL(pURL As %String = "") as %String
Return a registry service name given an URL
classmethod getServiceOIDFromURL(pURL As %String = "") as %String
Return a registry service OID given an URL
classmethod getServiceURLFromOID(pOID As %String = "", pOIDType As %String = "", pFunction As %String = "", pServiceType As %String = "") as %String
Return a domain and URL (e.g., http://host:port/url) given an OID
classmethod getSystemOID(pSystem As %String = "") as %String
classmethod getURLForCode(pCode As %String = "", pType As %String = "", pDefault As %String = "") as %String
classmethod getUniqueTime(pKey As %String = "", pValue As %String) as %String
Work around for bug in viewer that looses documents with same date/time over different encounters It will return a unique timestamp for the current transform as close to the input timestamp as possible
classmethod hex2dec(pHex As %String = "") as %String
Convert a hexidecimal number to decimal While $ZHEX has a max hex input length of 16, this method has no limit -- only cpu/ram will affect max input length
classmethod lookup(table, value) as %String
Convert a lookup
classmethod lookupIHETransaction(pIHETransactionType As %String = "") as %String
Lookup an IHE transaction code and return the display name
classmethod makeURL(Args...) as %String
Create a valid URL
classmethod returnAsLocal(datetime As %String) as %String
Used to take a UTC date/time (YYYY-MM-DDTHH:MM:SSZ) and return as a local date/time (YYYY-MM-DDTHH:MM:SS+/-HH:MM)
classmethod returnAsUTC(datetime As %String) as %String
Used to take a standard date/time (YYYY-MM-DD HH:MM:SS) and return as UTC (YYYYMMDDHHMMSSZ)
classmethod timestamp(pEpoch As %String = $Horolog) as %String
Compute a timestamp
classmethod timestamptoxml(pTS As %String) as %String
classmethod uuid2oid(pUUID As %String = "") as %String
classmethod varArgsToNameValue(pHasValue As %Boolean = 0, ByRef pName As %String, Args...) as %String
Turn an arg list into a variable name and optionally a value
classmethod varConcat(Args...) as %String
Concatenate a value onto a variable in the cache
classmethod varData(Args...) as %String
Check for data in a var
classmethod varDebug(Args...) as %String
Merge the variable cache into a debug global
classmethod varGet(Args...) as %String
Get a variable
classmethod varInc(Args...) as %String
Increment a variable
classmethod varKill(Args...) as %String
Kill a variable in the cache.
classmethod varReset() as %String
Clear the variable cache. Call before each transform either from code or the XSL itself
classmethod varSet(Args...) as %String
Set a variable in the cache
classmethod xmltimestamp(pDate) as %String
Convert an HL7 date of the form YYYYMMDDHHMM into a standard XML date
classmethod xmltimestampToUTC(pDateTime) as %String
Convert xmltimestamp with offset to timestamp with UTC
classmethod xmltimestampisbefore(pTS1 As %String, pTS2 As %String = "{$ZDateTime($Horolog, 3)}") as %Boolean
Compare two XML timestamps, returns true if pTS1 is the same as or before pTS2

Inherited Members

Inherited Methods

FeedbackOpens in a new tab