How to use the z-schema.setRemoteReference function in z-schema

To help you get started, we’ve selected a few z-schema examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github amida-tech / blue-button / lib / validator / validator.js View on Github external
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'
    };
github amida-tech / blue-button / lib / validator / validator.js View on Github external
};

    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'
    };
github amida-tech / blue-button / lib / validator / validator.js View on Github external
};

    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'
    };
github amida-tech / blue-button / lib / validator / validator.js View on Github external
};

    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'
    };
github amida-tech / blue-button / lib / validator / validator.js View on Github external
};

    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'
    };
github amida-tech / blue-button / lib / validator / validator.js View on Github external
};

    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'
    };
github amida-tech / blue-button / lib / validator / validator.js View on Github external
};

    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'
    };
github amida-tech / blue-button / lib / validator / validator.js View on Github external
};

    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'
    };
github amida-tech / blue-button / lib / validator / validator.js View on Github external
};

    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'
    };
github amida-tech / blue-button / lib / validator / validator.js View on Github external
};

    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'
    };