Skip to main content

HS.HC.Util

class HS.HC.Util

HS.HC.Util contains common utility methods for Health Connect.

Method Inventory

Methods

classmethod GetFormatFromData(pStreamOrString="", ByRef pFormat As %String) as %Status
API GetFormatFromData derives a JSON-or-XML format designation for the specified string or stream data, and returns it in the pFormat parameter. If the first non-whitespace character found is left curly brace ("{"), then pFormat is returned as "json". If the first non-whitespace character found is left angle bracket ("<") then pFormat is returned as "xml". Otherwise pFormat is returned as blank string, and an error status is returned.

Note that this method does NOT verify that the specified data is well-formed JSON or XML.
classmethod IsOID(pString As %String, pPrefixRequired As %Boolean = 0) as %Boolean
API IsOID returns 1 if the specified string is an OID, returns 0 if not. The Regex for OID is "urn:oid:[0-2](\.(0|[1-9][0-9]*))+". Requirement for the presence of the "urn:oid:" prefix is determined by the pPrefixRequired input parameter. Once prefix is verified per the requirement, the remainder of validation takes place with the prefix stripped.
classmethod IsURI(pString As %String, pParameterNoLongerUsed) as %Boolean
API IsURI returns 1 if the specified string is a URI, returns 0 if not. This method is intended to validate URIs that will be used within various payloads such as SOAP requests and responses and FHIR resources. Therefore URI prefixes are required to be all lowercase.
classmethod IsURL(pString As %String, pAllowPathOnly As %Boolean = 0) as %Boolean
API IsURL returns 1 if the specified string is a URL, returns 0 if not. The pAllowPathOnly input parameter toggles the allowing of a path-only URL string to be specified.
classmethod IsUUID(pString As %String, pPrefixRequired As %Boolean = 0) as %Boolean
API IsUUID returns 1 if the specified string is a UUID, returns 0 if not. Requirement for the presence of the "urn:uuid:" prefix is determined by the pPrefixRequired input parameter. Once prefix is verified per the requirement, the remainder of validation takes place with the prefix stripped.
classmethod VerifyLOCALTEMP(pNamespace As %String, Output pMsgs)
Verify that the settings on the specified database are as expected for this kind of database:
- DB resource is %DB_ - non-matching resource is okay if all other criteria are met.
- DB journaling is disabled.
- DB is not mirrored.
- DB resource does not allow public access.
FeedbackOpens in a new tab