UNPKG

fhirbuilder

Version:
71 lines (70 loc) 2.42 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.EncounterDiagnosisBuilder = 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 EncounterDiagnosis * @class EncounterDiagnosisBuilder * @extends {BackboneBuilder} * @implements {IEncounterDiagnosisBuilder} * @author Roberto Araneda Espinoza */ class EncounterDiagnosisBuilder extends base_1.BackboneBuilder { encounterDiagnosis; constructor() { super(); this.encounterDiagnosis = new models_1.EncounterDiagnosis(); } /** * @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.encounterDiagnosis[param] = extension; return this; } /** * @description Builds the model * @returns {EncounterDiagnosis} */ build() { return Object.assign(this.encounterDiagnosis, super.build()); } /** * @description Sets the condition value * @description Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure. * @param value - the value to set * @returns {this} */ setCondition(value) { this.encounterDiagnosis.condition = value; return this; } /** * @description Sets the use value * @description Role that this diagnosis has within the encounter (e.g. admission, billing, discharge …). * @param value - the value to set * @returns {this} */ setUse(value) { this.encounterDiagnosis.use = value; return this; } /** * @description Sets the rank value * @description Ranking of the diagnosis (for each role type). * @param value - the value to set * @returns {this} */ setRank(value) { this.encounterDiagnosis.rank = value; return this; } } exports.EncounterDiagnosisBuilder = EncounterDiagnosisBuilder;