UNPKG

fhirbuilder

Version:
44 lines (43 loc) 2.01 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.HealthcareServiceAvailableTimeValidator = HealthcareServiceAvailableTimeValidator; 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 HealthcareServiceAvailableTime model */ const modelFields = (0, definitions_1.createBackboneDefinition)([ { name: 'daysOfWeek', type: 'string', isArray: true, isRequired: false, enumValues: ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'], }, { name: '_daysOfWeek', type: 'Element', isArray: true, isRequired: false }, { name: 'allDay', type: 'boolean', isArray: false, isRequired: false }, { name: '_allDay', type: 'Element', isArray: false, isRequired: false }, { name: 'availableStartTime', type: 'time', isArray: false, isRequired: false }, { name: '_availableStartTime', type: 'Element', isArray: false, isRequired: false }, { name: 'availableEndTime', type: 'time', isArray: false, isRequired: false }, { name: '_availableEndTime', type: 'Element', isArray: false, isRequired: false }, ]); /** * @description Validates the HealthcareServiceAvailableTime model * @param dataToValidate - the HealthcareServiceAvailableTime model to validate * @param path - the path to the model * @param errors - the errors array */ function HealthcareServiceAvailableTimeValidator(dataToValidate, path = 'HealthcareServiceAvailableTime', errors = []) { // Ensure that the model fields match the attributes of the model (0, utils_1.AssertModelFieldsMatchAttributes)(modelFields, new models_1.HealthcareServiceAvailableTime()); // Validate the model and add any errors to the errors array (0, base_1.ModelValidator)({ dataToValidate, modelDefinition: modelFields, path, errors, }); }