UNPKG

fhirbuilder

Version:
74 lines (73 loc) 2.01 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Duration = void 0; const Element_1 = require("../base/Element"); const builders_1 = require("../../builders"); const base_1 = require("../../../core/r4/validators/base"); class Duration extends Element_1.Element { /** * @description The value of the measured amount. The value includes an implicit precision in the presentation of the value. */ value; /** * @description How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is "<" , then the real value is < stated value. */ comparator; /** * @description A human-readable form of the unit. */ unit; /** * @description The identification of the system that provides the coded form of the unit. */ system; /** * @description A computer processable form of the unit in some unit representation system. */ code; /** * @description Extensions for value */ _value; /** * @description Extensions for comparator */ _comparator; /** * @description Extensions for unit */ _unit; /** * @description Extensions for system */ _system; /** * @description Extensions for code */ _code; toJson() { return JSON.parse(JSON.stringify(this)); } toPrettyString() { return JSON.stringify(this.toJson(), null, 2); } toString() { return JSON.stringify(this.toJson()); } constructor(args) { super(); if (args) { Object.assign(this, args); } } builderInstance() { return new builders_1.DurationBuilder(); } serialize() { return JSON.stringify(this.toJson()); } validate() { return (0, base_1.ConformanceValidator)('Duration', this); } } exports.Duration = Duration;