UNPKG

fhirbuilder

Version:
111 lines (110 loc) 3.39 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Bundle = void 0; const base_1 = require("../base"); const base_2 = require("../../../core/r4/validators/base"); /** * @version R4 (v4.0.1) * @summary FHIR® Specification by HL7® * @description Class for Bundle Resource * @property {string} resourceType * @property {IIdentifier} identifier * @property {BundleTypeType} type * @property {IElement} _type * @property {string} timestamp * @property {IElement} _timestamp * @property {number} total * @property {IElement} _total * @property {IBundleLink[]} link * @property {IBundleEntry[]} entry * @property {ISignature} signature * @author Roberto Araneda Espinoza */ class Bundle extends base_1.DomainResource { /** * @description The type of resource */ resourceType = 'Bundle'; /** * @description A persistent identifier for the bundle that won't change as a bundle is copied from server to server. */ identifier; /** * @description Indicates the purpose of this bundle - how it is intended to be used. document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection. */ type; /** * @description Extensions for type */ _type; /** * @description The date/time that the bundle was assembled - i.e. when the resources were placed in the bundle. */ timestamp; /** * @description Extensions for timestamp */ _timestamp; /** * @description If a set of search matches, this is the total number of entries of type 'match' across all pages in the search. It does not include search.mode = 'include' or 'outcome' entries and it does not provide a count of the number of entries in the Bundle. */ total; /** * @description Extensions for total */ _total; /** * @description A series of links that provide context to this bundle. */ link; /** * @description An entry in a bundle resource - will either contain a resource or information about a resource (transactions and history only). */ entry; /** * @description Digital Signature - base64 encoded. XML-DSig or a JWT. */ signature; /** * @description Returns a JSON representation of the model * @returns {Record<string, any>} */ toJson() { return JSON.parse(JSON.stringify(this)); } /** * @description Returns a string representation of the model * @returns {string} */ toString() { return `Bundle${JSON.stringify(this.toJson())}`; } /** * @description Returns a pretty string representation of the model * @returns {string} */ toPrettyString() { return `Bundle${JSON.stringify(this.toJson(), null, 2)}`; } /** * @description Returns a serialized string representation of the model * @returns {string} */ serialize() { return JSON.stringify(this.toJson()); } /** * @description Validates the model * @returns {isValid: boolean, operationOutcome: IOperationOutcome} */ validate() { return (0, base_2.ConformanceValidator)('Bundle', this); } constructor(args) { super(); if (args) Object.assign(this, args); } } exports.Bundle = Bundle;