mitre / ecqm

Server side components to support electronic clinical quality measure calculation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Javascript Error in Quality Report responses.

kindofluke opened this issue · comments

MITRE Team-

Per our conversation last week, I am opening up a github issue to try and resolve the error with measure calculation that we have been seeing in our prototypes here. I have successfully scripted my set-up and deployment of the various systems so I can recreate the error reliably. I have posted a repo of my vagrant and install scripts at OpenHealthVagrant so you can reference them.

Error Steps:

  1. Create a quality report by posting to /QualityReport
curl --request POST \
  --url http://localhost:3001/QualityReport \
  --header 'content-type: multipart/form-data; boundary=---011000010111000001101001' \
  --form measureId=40280381-4BE2-53B3-014B-E6419B2C033E \
  --form effectiveDate=201401

from which i receive the following response:

{
	"id": "58e64dd7ca658a4358bcd188",
	"calculationTime": "0001-01-01T00:00:00Z",
	"status": {
		"state": "requested"
	},
	"measureId": "40280381-4BE2-53B3-014B-E6419B2C033E",
	"effectiveDate": 201401,
	"result": {
		"populationIds": {},
		"initialPatientPopulation": 0,
		"denominator": 0,
		"exception": 0,
		"exclusion": 0,
		"numerator": 0,
		"antinumerator": 0,
		"measurePopulation": 0,
		"observation": 0
	}
}
  1. Request report status
 curl --request GET \
  --url http://localhost:3001/QualityReport/58e64dd7ca658a4358bcd188

Response:

{
	"id": "58e64dd7ca658a4358bcd188",
	"calculationTime": "0001-01-01T00:00:00Z",
	"status": {
		"state": "failed",
		"log": [
			"SyntaxError: Unexpected token &&",
			"SyntaxError: Unexpected token &&"
		]
	},
	"measureId": "40280381-4BE2-53B3-014B-E6419B2C033E",
	"effectiveDate": 201401,
	"result": {
		"populationIds": {},
		"initialPatientPopulation": 0,
		"denominator": 0,
		"exception": 0,
		"exclusion": 0,
		"numerator": 0,
		"antinumerator": 0,
		"measurePopulation": 0,
		"observation": 0
	}
}

The following is then shown in the logs of the calculation_job queue from node_cqm_engine:

worker polling rollup  openhealth:17175
worker paused
worker polling calculate  openhealth:17175
worker polling rollup  openhealth:17175
worker paused
worker polling calculate  openhealth:17175
working job calculate {"class":"calculate","queue":"calculate","args":["58e64dd7ca658a4358bcd188"]}
Mongoose: mpromise (mongoose's default promise library) is deprecated, plug in your own promise library instead: http://mongoosejs.com/docs/promises.html
job failure calculate {"class":"calculate","queue":"calculate","args":["58e64dd7ca658a4358bcd188"]} >> Error: refusing to continue with job, multiple callbacks detected
job failure calculate {"class":"calculate","queue":"calculate","args":["58e64dd7ca658a4358bcd188"]} >> Error: refusing to continue with job, multiple callbacks detected

I have to restart calculation_job before i can continue.

The same occurs when i make calls using the ecqm_frontend which is working but the Quality reports get created and simply remain pending after the error above is thrown.

I am attaching two shell scripts which create my environment. The first install-basics sets up the databases and checks out the code from the repositories. the second loadserver.sh does more specific tasks all of which run succesfully.

  1. download and load the measure bundle
  2. build the ecqm_frontend with webpack
  3. generate the FHIR synthetic patients

Then all i need to do is start the queues and the ecqm server and I am good to go.

For extra reference, the databases are populated nicely. The following is just a quick check of the mongoDB:

> use fhir
switched to db fhir
> db.patients.count()
102
> db.procedures.count()
274
> db.medicationorders.count()
428
> 

If you can help that would be great thanks so much.

Luke