-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting error while evaluating valuesets #274
Comments
Hi @nehaghub. If I had to guess, it seems like you are not passing in a CodeService when you construct the cql-execution If you aren't passing one in to the constructor, then you need to do so. If you're using value sets from VSAC, then you can use the cql-exec-vsac code service. If you are passing in a code service and still getting this error, then we'll need more information:
|
Hi,
const cqlfhir = require('../lib'); parameters = { const elmFile = JSON.parse(fs.readFileSync('C:/Users/neha.f.goel/tt/bcs.json', 'utf8')); const bundles = []; const patientsPath = 'mcode1_0_longitudinal/longitudinal/female'; const patientSource = cqlfhir.PatientSource.FHIRv401(); // or .FHIRv300() or .FHIRv400() patientSource.loadBundles(bundles); // let valueSets = []; // if (elmFile.library && elmFile.library.valueSets && elmFile.library.valueSets.def) { // const codeService = new vsac.CodeService('C:/Users/neha.f.goel/tt/jim_cql/valuesets/vsac_cache/', true); console.log("b4 execution") ; // const executor = new cql.Executor(library, codeService,parameters); console.log(JSON.stringify(results, undefined, 2)); |
I apologize for the long delay in getting back to you. In your code above, you have commented out the lines that initialize a code service and pass it into the Executor. As I noted in my previous response, you need to pass in a CodeService as the 2nd argument to the executor. |
C:\Users\neha.f.goel\tt\cql-execution\lib\elm\clinical.js:35
const valueset = ctx.codeService.findValueSet(this.id, this.version) || new dt.ValueSet(this.id, this.version);
^
TypeError: Cannot read properties of undefined (reading 'findValueSet')
at ValueSetDef.exec (C:\Users\neha.f.goel\tt\cql-execution\lib\elm\clinical.js:35:42)
at ValueSetDef.execute (C:\Users\neha.f.goel\tt\cql-execution\lib\elm\expression.js:29:25)
at ValueSetRef.exec (C:\Users\neha.f.goel\tt\cql-execution\lib\elm\clinical.js:51:33)
at ValueSetRef.execute (C:\Users\neha.f.goel\tt\cql-execution\lib\elm\expression.js:29:25)
at Retrieve.exec (C:\Users\neha.f.goel\tt\cql-execution\lib\elm\external.js:22:46)
at Retrieve.execute (C:\Users\neha.f.goel\tt\cql-execution\lib\elm\expression.js:29:25)
at C:\Users\neha.f.goel\tt\cql-execution\lib\elm\expression.js:37:45
at Array.map ()
at Union.execArgs (C:\Users\neha.f.goel\tt\cql-execution\lib\elm\expression.js:37:30)
at Union.exec (C:\Users\neha.f.goel\tt\cql-execution\lib\elm\overloaded.js:83:29)
Please help me for the same.
Thanks
Neha
The text was updated successfully, but these errors were encountered: