UNPKG

fhirbuilder

Version:
81 lines (80 loc) 2.71 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.EncounterLocationBuilder = 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 EncounterLocation * @class EncounterLocationBuilder * @extends {BackboneBuilder} * @implements {IEncounterLocationBuilder} * @author Roberto Araneda Espinoza */ class EncounterLocationBuilder extends base_1.BackboneBuilder { encounterLocation; constructor() { super(); this.encounterLocation = new models_1.EncounterLocation(); } /** * @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.encounterLocation[param] = extension; return this; } /** * @description Builds the model * @returns {EncounterLocation} */ build() { return Object.assign(this.encounterLocation, super.build()); } /** * @description Sets the location value * @description The location where the encounter takes place. * @param value - the value to set * @returns {this} */ setLocation(value) { this.encounterLocation.location = value; return this; } /** * @description Sets the status value * @description The status of the participants' presence at the specified location during the period specified. If the participant is no longer at the location, then the period will have an end date/time. * @param value - the value to set * @returns {this} */ setStatus(value) { this.encounterLocation.status = value; return this; } /** * @description Sets the physicalType value * @description This will be used to specify the required levels (bed/ward/room/etc.) desired to be recorded to simplify either messaging or query. * @param value - the value to set * @returns {this} */ setPhysicalType(value) { this.encounterLocation.physicalType = value; return this; } /** * @description Sets the period value * @description Time period during which the patient was present at the location. * @param value - the value to set * @returns {this} */ setPeriod(value) { this.encounterLocation.period = value; return this; } } exports.EncounterLocationBuilder = EncounterLocationBuilder;