fhirbuilder
Version:
Another FHIR Tool to build FHIR Resources
71 lines (70 loc) • 2.34 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.EpisodeOfCareDiagnosisBuilder = 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 EpisodeOfCareDiagnosis
* @class EpisodeOfCareDiagnosisBuilder
* @extends {BackboneBuilder}
* @implements {IEpisodeOfCareDiagnosisBuilder}
* @author Roberto Araneda Espinoza
*/
class EpisodeOfCareDiagnosisBuilder extends base_1.BackboneBuilder {
episodeOfCareDiagnosis;
constructor() {
super();
this.episodeOfCareDiagnosis = new models_1.EpisodeOfCareDiagnosis();
}
/**
* @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.episodeOfCareDiagnosis[param] = extension;
return this;
}
/**
* @description Builds the model
* @returns {EpisodeOfCareDiagnosis}
*/
build() {
return Object.assign(this.episodeOfCareDiagnosis, super.build());
}
/**
* @description Sets the condition value
* @description A list of conditions/problems/diagnoses that this episode of care is intended to be providing care for.
* @param value - the value to set
* @returns {this}
*/
setCondition(value) {
this.episodeOfCareDiagnosis.condition = value;
return this;
}
/**
* @description Sets the role value
* @description Role that this diagnosis has within the episode of care (e.g. admission, billing, discharge …).
* @param value - the value to set
* @returns {this}
*/
setRole(value) {
this.episodeOfCareDiagnosis.role = 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.episodeOfCareDiagnosis.rank = value;
return this;
}
}
exports.EpisodeOfCareDiagnosisBuilder = EpisodeOfCareDiagnosisBuilder;