UNPKG

fhirbuilder

Version:
34 lines (33 loc) 1.56 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PractitionerQualificationValidator = PractitionerQualificationValidator; const definitions_1 = require("../base/definitions"); const base_1 = require("../base"); const utils_1 = require("../../../commons/utils"); const models_1 = require("../../../../r4/models"); /** * @description The model fields for the PractitionerQualification model */ const modelFields = (0, definitions_1.createBackboneDefinition)([ { name: 'identifier', type: 'Identifier', isArray: true, isRequired: false }, { name: 'code', type: 'CodeableConcept', isArray: false, isRequired: true }, { name: 'period', type: 'Period', isArray: false, isRequired: false }, { name: 'issuer', type: 'Reference', isArray: false, isRequired: false, referenceTypes: ['Organization'] }, ]); /** * @description Validates the PractitionerQualification model * @param dataToValidate - the PractitionerQualification model to validate * @param path - the path to the model * @param errors - the errors array */ function PractitionerQualificationValidator(dataToValidate, path = 'PractitionerQualification', errors = []) { // Ensure that the model fields match the attributes of the model (0, utils_1.AssertModelFieldsMatchAttributes)(modelFields, new models_1.PractitionerQualification()); // Validate the model and add any errors to the errors array (0, base_1.ModelValidator)({ dataToValidate, modelDefinition: modelFields, path, errors, }); }