UNPKG

fhirbuilder

Version:
61 lines (60 loc) 1.94 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BundleLinkBuilder = void 0; const models_1 = require("../../models"); const base_1 = require("../base"); /** * @version R4 (v4.0.1) * @summary FHIR® Specification by HL7® * @description Class for building a BundleLink * @class BundleLinkBuilder * @extends {BackboneBuilder} * @implements {IBundleLinkBuilder} * @author Roberto Araneda Espinoza */ class BundleLinkBuilder extends base_1.BackboneBuilder { bundleLink; constructor() { super(); this.bundleLink = new models_1.BundleLink(); } /** * @description Adds a primitive extension to the element * @param param - the field to add the extension to * @param extension - the extension to add * @returns {this} * @example addPrimitiveExtension('_value', { value: 'test' }) */ addPrimitiveExtension(param, extension) { this.bundleLink[param] = extension; return this; } /** * @description Builds the model * @returns {BundleLink} */ build() { return Object.assign(this.bundleLink, super.build()); } /** * @description Sets the relation value * @description A name which details the functional use for this link - see [http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1](http://www.iana.org/assignments/link-relations/link-relations.xhtml#link-relations-1). * @param value - the value to set * @returns {this} */ setRelation(value) { this.bundleLink.relation = value; return this; } /** * @description Sets the url value * @description The reference details for the link. * @param value - the value to set * @returns {this} */ setUrl(value) { this.bundleLink.url = value; return this; } } exports.BundleLinkBuilder = BundleLinkBuilder;