fhirbuilder
Version:
Another FHIR Tool to build FHIR Resources
61 lines (60 loc) • 1.81 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PatientLinkBuilder = 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 PatientLink
* @class PatientLinkBuilder
* @extends {BackboneBuilder}
* @implements {IPatientLinkBuilder}
* @author Roberto Araneda Espinoza
*/
class PatientLinkBuilder extends base_1.BackboneBuilder {
patientLink;
constructor() {
super();
this.patientLink = new models_1.PatientLink();
}
/**
* @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.patientLink[param] = extension;
return this;
}
/**
* @description Builds the model
* @returns {PatientLink}
*/
build() {
return Object.assign(this.patientLink, super.build());
}
/**
* @description Sets the other value
* @description The other patient resource that the link refers to.
* @param value - the value to set
* @returns {this}
*/
setOther(value) {
this.patientLink.other = value;
return this;
}
/**
* @description Sets the type value
* @description The type of link between this patient resource and another patient resource.
* @param value - the value to set
* @returns {this}
*/
setType(value) {
this.patientLink.type = value;
return this;
}
}
exports.PatientLinkBuilder = PatientLinkBuilder;