Skip to main content

HS.Types.TimeStamp

datatype class HS.Types.TimeStamp extends %Library.TimeStamp

ODBC Type: TIMESTAMP

HealthShare-specific version of %TimeStamp so that on XML import we do
not lose the delete instruction (two double quotes) to validation.
Also implements a PRECISION parameter to support partial dates:
-If PRECISION is "TIME", value must be a full timestamp.
-If PRECISION is "DATE", value may also be formatted as YYYY-MM-DD.
-If PRECISION is "PARTIALDATE", value may also be formatted as YYYY-MM and
YYYY.
There is also an additional value available for the XMLTIMEZONE parameter,
"LOCAL" (the default). If XMLTIMEZONE = "LOCAL", then an imported timestamp
with a UTC offset will be converted to local time (local to the HealthShare
instance), and once imported, the offset will no longer be included in the
value.

Method Inventory

Parameters

parameter PRECISION = TIME;
"TIME" is the same precision as a %TimeStamp - the date and time components
are required.
"DATE" means that the time component is optional.
"PARTIALDATE" means that the time component is optional, and also permits
YYYY-MM and YYYY
parameter XMLTIMEZONE = IGNORE;
XMLTIMEZONE specifies the handling of timezone part of the XML format
dateTime.
"UTC" means convert to UTC on input.
"IGNORE" means ignore the timezone.
"LOCAL" means convert the timestamp to local time on input.
parameter XSDTYPE = string;
Declares the XSD type used when projecting XML Schemas.

Methods

classmethod IsValid(%val As %Library.RawString) as %Status
Modified from the superclass method to allow the delete instruction (two
double quotes) and possibly (depending on the PRECISION parameter) partial
dates to pass validation.
classmethod LogicalToTimeStamp(pVal, pFlavor As %String = "end") as %String
This resolves a partial date or date into a full time stamp
pFlavor can be start or end
(***TBD - later - add support for middle?)
classmethod LogicalToXSD(%val As %TimeStamp) as %String
Converts the Cache %TimeStamp value to the canonical SOAP encoded value.
Modified from the superclass method to allow the export of partial dates.
classmethod Normalize(%val As %Library.RawString) as %TimeStamp
Inherited description: Transforms Logical Date or ODBC Date values into timestamp. Date only values are converted to Timestamp values with a time of 00:00:00. Time only values are converted to TImestamp value with a date of current date
classmethod XSDToLogical(%val As %String) as %TimeStamp
Modified from the superclass method to allow the import of the delete
instruction (two double quotes) and partial dates, and to convert a
timestamp to local time when XMLTIMEZONE="LOCAL". Additionally modified to allow local time to include time zone offset.

Inherited Members

Inherited Methods

Subclasses

FeedbackOpens in a new tab