Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function executeElmAgainstPatientSource(executionInputs, patientSource) {
// executionInputs.elmDependencies = [ fhirhelpersElm ]
const repository = new cql.Repository(executionInputs.elmDependencies);
const lib = new cql.Library(executionInputs.elm, repository);
const codeService = new cql.CodeService(executionInputs.valueSetDB);
const executor = new cql.Executor(lib, codeService, executionInputs.parameters);
const results = executor.exec(patientSource);
return results.patientResults[Object.keys(results.patientResults)[0]];
}
.then(() => {
// Value sets are loaded, so execute!
const executor = new cql.Executor(library, codeService, cqlExecParams);
const results = executor.exec(patientSource);
return results;
});
}
function executeElmAgainstPatientSource(executionInputs, patientSource) {
executionInputs.elmDependencies = [ fhirhelpersElm ]
const repository = new cql.Repository(executionInputs.elmDependencies);
const lib = new cql.Library(executionInputs.elm, repository);
const codeService = new cql.CodeService(executionInputs.valueSetDB);
const executor = new cql.Executor(lib, codeService, executionInputs.parameters);
const results = executor.exec(patientSource);
return results.patientResults[Object.keys(results.patientResults)[0]];
}