Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var validator = function validator() {
var fs = require("fs");
var ZSchema = require("z-schema");
var lastError;
//setup references
var shared = fs.readFileSync(__dirname + '/schemas/shared.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/common_models', shared);
var sharedSchema = {
'$ref': 'http://local.com/common_models'
};
var demographics = fs.readFileSync(__dirname + '/schemas/demographics.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/demographics', demographics);
var demographicsSchema = {
'$ref': 'http://local.com/demographics'
};
var allergy = fs.readFileSync(__dirname + '/schemas/allergy.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/allergy', allergy);
var allergySchema = {
'$ref': 'http://local.com/allergy'
};
var encounter = fs.readFileSync(__dirname + '/schemas/encounter.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/encounter', encounter);
var encounterSchema = {
'$ref': 'http://local.com/encounter'
};
};
var demographics = fs.readFileSync(__dirname + '/schemas/demographics.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/demographics', demographics);
var demographicsSchema = {
'$ref': 'http://local.com/demographics'
};
var allergy = fs.readFileSync(__dirname + '/schemas/allergy.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/allergy', allergy);
var allergySchema = {
'$ref': 'http://local.com/allergy'
};
var encounter = fs.readFileSync(__dirname + '/schemas/encounter.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/encounter', encounter);
var encounterSchema = {
'$ref': 'http://local.com/encounter'
};
var immunization = fs.readFileSync(__dirname + '/schemas/immunization.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/immunization', immunization);
var immunizationSchema = {
'$ref': 'http://local.com/immunization'
};
var medication = fs.readFileSync(__dirname + '/schemas/medication.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/medication', medication);
var medicationSchema = {
'$ref': 'http://local.com/medication'
};
};
var payers = fs.readFileSync(__dirname + '/schemas/payers.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/payers', payers);
var payersSchema = {
'$ref': 'http://local.com/payers'
};
var result = fs.readFileSync(__dirname + '/schemas/result.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/result', result);
var resultSchema = {
'$ref': 'http://local.com/result'
};
var social_history = fs.readFileSync(__dirname + '/schemas/social_history.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/social_history', social_history);
var socialHistorySchema = {
'$ref': 'http://local.com/social_history'
};
var vital = fs.readFileSync(__dirname + '/schemas/vital.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/vital', vital);
var vitalSchema = {
'$ref': 'http://local.com/vital'
};
var insurance = fs.readFileSync(__dirname + '/schemas/insurance.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/insurance', insurance);
var insuranceSchema = {
'$ref': 'http://local.com/insurance'
};
};
var problem = fs.readFileSync(__dirname + '/schemas/problem.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/problem', problem);
var problemSchema = {
'$ref': 'http://local.com/problem'
};
var procedure = fs.readFileSync(__dirname + '/schemas/procedure.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/procedure', procedure);
var procedureSchema = {
'$ref': 'http://local.com/procedure'
};
var plan_of_care = fs.readFileSync(__dirname + '/schemas/plan_of_care.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/plan_of_care', plan_of_care);
var plan_of_careSchema = {
'$ref': 'http://local.com/plan_of_care'
};
var payers = fs.readFileSync(__dirname + '/schemas/payers.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/payers', payers);
var payersSchema = {
'$ref': 'http://local.com/payers'
};
var result = fs.readFileSync(__dirname + '/schemas/result.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/result', result);
var resultSchema = {
'$ref': 'http://local.com/result'
};
};
var procedure = fs.readFileSync(__dirname + '/schemas/procedure.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/procedure', procedure);
var procedureSchema = {
'$ref': 'http://local.com/procedure'
};
var plan_of_care = fs.readFileSync(__dirname + '/schemas/plan_of_care.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/plan_of_care', plan_of_care);
var plan_of_careSchema = {
'$ref': 'http://local.com/plan_of_care'
};
var payers = fs.readFileSync(__dirname + '/schemas/payers.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/payers', payers);
var payersSchema = {
'$ref': 'http://local.com/payers'
};
var result = fs.readFileSync(__dirname + '/schemas/result.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/result', result);
var resultSchema = {
'$ref': 'http://local.com/result'
};
var social_history = fs.readFileSync(__dirname + '/schemas/social_history.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/social_history', social_history);
var socialHistorySchema = {
'$ref': 'http://local.com/social_history'
};
};
var immunization = fs.readFileSync(__dirname + '/schemas/immunization.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/immunization', immunization);
var immunizationSchema = {
'$ref': 'http://local.com/immunization'
};
var medication = fs.readFileSync(__dirname + '/schemas/medication.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/medication', medication);
var medicationSchema = {
'$ref': 'http://local.com/medication'
};
var problem = fs.readFileSync(__dirname + '/schemas/problem.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/problem', problem);
var problemSchema = {
'$ref': 'http://local.com/problem'
};
var procedure = fs.readFileSync(__dirname + '/schemas/procedure.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/procedure', procedure);
var procedureSchema = {
'$ref': 'http://local.com/procedure'
};
var plan_of_care = fs.readFileSync(__dirname + '/schemas/plan_of_care.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/plan_of_care', plan_of_care);
var plan_of_careSchema = {
'$ref': 'http://local.com/plan_of_care'
};
};
var vital = fs.readFileSync(__dirname + '/schemas/vital.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/vital', vital);
var vitalSchema = {
'$ref': 'http://local.com/vital'
};
var insurance = fs.readFileSync(__dirname + '/schemas/insurance.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/insurance', insurance);
var insuranceSchema = {
'$ref': 'http://local.com/insurance'
};
var claims = fs.readFileSync(__dirname + '/schemas/claims.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/claims', claims);
var claimsSchema = {
'$ref': 'http://local.com/claims'
};
var provider = fs.readFileSync(__dirname + '/schemas/provider.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/provider', provider);
var providerSchema = {
'$ref': 'http://local.com/provider'
};
var document_model = fs.readFileSync(__dirname + '/schemas/document_model.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/document_model', document_model);
var documentModelSchema = {
'$ref': 'http://local.com/document_model'
};
};
var plan_of_care = fs.readFileSync(__dirname + '/schemas/plan_of_care.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/plan_of_care', plan_of_care);
var plan_of_careSchema = {
'$ref': 'http://local.com/plan_of_care'
};
var payers = fs.readFileSync(__dirname + '/schemas/payers.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/payers', payers);
var payersSchema = {
'$ref': 'http://local.com/payers'
};
var result = fs.readFileSync(__dirname + '/schemas/result.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/result', result);
var resultSchema = {
'$ref': 'http://local.com/result'
};
var social_history = fs.readFileSync(__dirname + '/schemas/social_history.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/social_history', social_history);
var socialHistorySchema = {
'$ref': 'http://local.com/social_history'
};
var vital = fs.readFileSync(__dirname + '/schemas/vital.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/vital', vital);
var vitalSchema = {
'$ref': 'http://local.com/vital'
};
};
var result = fs.readFileSync(__dirname + '/schemas/result.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/result', result);
var resultSchema = {
'$ref': 'http://local.com/result'
};
var social_history = fs.readFileSync(__dirname + '/schemas/social_history.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/social_history', social_history);
var socialHistorySchema = {
'$ref': 'http://local.com/social_history'
};
var vital = fs.readFileSync(__dirname + '/schemas/vital.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/vital', vital);
var vitalSchema = {
'$ref': 'http://local.com/vital'
};
var insurance = fs.readFileSync(__dirname + '/schemas/insurance.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/insurance', insurance);
var insuranceSchema = {
'$ref': 'http://local.com/insurance'
};
var claims = fs.readFileSync(__dirname + '/schemas/claims.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/claims', claims);
var claimsSchema = {
'$ref': 'http://local.com/claims'
};
};
var encounter = fs.readFileSync(__dirname + '/schemas/encounter.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/encounter', encounter);
var encounterSchema = {
'$ref': 'http://local.com/encounter'
};
var immunization = fs.readFileSync(__dirname + '/schemas/immunization.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/immunization', immunization);
var immunizationSchema = {
'$ref': 'http://local.com/immunization'
};
var medication = fs.readFileSync(__dirname + '/schemas/medication.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/medication', medication);
var medicationSchema = {
'$ref': 'http://local.com/medication'
};
var problem = fs.readFileSync(__dirname + '/schemas/problem.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/problem', problem);
var problemSchema = {
'$ref': 'http://local.com/problem'
};
var procedure = fs.readFileSync(__dirname + '/schemas/procedure.json', 'utf8');
ZSchema.setRemoteReference('http://local.com/procedure', procedure);
var procedureSchema = {
'$ref': 'http://local.com/procedure'
};