UNPKG

fhirbuilder

Version:
39 lines (38 loc) 1.58 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.EpisodeOfCareStatusHistoryValidator = EpisodeOfCareStatusHistoryValidator; 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 EpisodeOfCareStatusHistory model */ const modelFields = (0, definitions_1.createBackboneDefinition)([ { name: 'status', type: 'code', isArray: false, isRequired: true, enumValues: ['planned', 'waitlist', 'active', 'onhold', 'finished', 'cancelled', 'entered-in-error'], }, { name: '_status', type: 'Element', isArray: false, isRequired: false }, { name: 'period', type: 'Period', isArray: false, isRequired: true }, ]); /** * @description Validates the EpisodeOfCareStatusHistory model * @param dataToValidate - the EpisodeOfCareStatusHistory model to validate * @param path - the path to the model * @param errors - the errors array */ function EpisodeOfCareStatusHistoryValidator(dataToValidate, path = 'EpisodeOfCareStatusHistory', errors = []) { // Ensure that the model fields match the attributes of the model (0, utils_1.AssertModelFieldsMatchAttributes)(modelFields, new models_1.EpisodeOfCareStatusHistory()); // Validate the model and add any errors to the errors array (0, base_1.ModelValidator)({ dataToValidate, modelDefinition: modelFields, path, errors, }); }