Skip to content
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

QDM based Patient data sample that would work with AIS Measure CQL #122

Open
ramanathanga opened this issue Jun 20, 2019 · 6 comments
Open

Comments

@ramanathanga
Copy link

Hi,

We are trying to execute a measure CQL that uses QDM data as input.

We already tested a sample based on Readme as below, this was successful:
[(https://github.com/projecttacoma/cqm-execution/blob/master/README.md)]

Below are the 6 CQL measures published by NCQA which we have access to, and while trying to execute AIS measure CQL we understand we need a QDM based Patient and other related data.

Measures: AIS, ASF, DMS, DRR, DSF, PRS

**We are trying to get a QDM based Patient data sample that would work with AIS Measure CQL, can you pls. share a sample that we could use to test.

Larger picture, we are trying to understand how to create/generate QDM based data for Patient and other types as inputs to NCQA measures CQL (like AIS, ASF, DMS, DRR, DSF, PRS etc..). Are there any resources which you can point us to.**

Thanks,
Ganesh Ramanathan, Balaji Venkata Yadalla.

@mayerm94
Copy link
Contributor

Ganesh,

Based on your description, it sounds like you are trying to test a measure that uses CQL-based logic. This can be done on either https://bonnie.healthit.gov or https://bonnie-prior.healthit.gov/ depending on what version of CQL and QDM the measure was written in.
If you are interested in programmatically creating QDM-based patients, you should checkout the cqm-models repository https://github.com/projecttacoma/cqm-models. Specifically, you should look at the patient generation script https://github.com/projecttacoma/cqm-models/blob/master/lib/generate_patients.rb which creates a patient object containing QDM data elements, these patients can be used to calculate against measures using the cqm-execution repository https://github.com/projecttacoma/cqm-execution/.

-Matt

@ramanathanga
Copy link
Author

ramanathanga commented Jun 25, 2019

Thanks Matt for the responses.
When we try to execute generate_patients.rb (https://github.com/projecttacoma/cqm-models/blob/master/lib/generate_patients.rb), we are getting errors as below.

Server:/users/s01/cqm-models/bin
>./validate_generator.sh
../lib/generate_models.rb:15: odd number list for Hash
  'System.DateTime': 'DateTime',
                    ^
../lib/generate_models.rb:15: syntax error, unexpected ':', expecting '}'
  'System.DateTime': 'DateTime',
                    ^
../lib/generate_models.rb:15: syntax error, unexpected ',', expecting $end
Differences found when running generator script!  Make sure there are no
  unstaged or untracked files.

Would you be able to tell us what version the Ruby codes are written?
We have Ruby 1.8.7 and are checking the compatibility.

Below are the steps we are following to generate data, could you pls. tell us if are we missing any step or on right track:

  1. git clone cql-models
  2. yarn (to install all dependencies in package-,json)
  3. generate_models (currently failing at this step)
  4. generate_patients
  5. Add some more characteristics to generate_patient.rb and generate patient data again

Also, when we try to execute generate_patients.rb we get below error, is there any additional package(s) that needs to be installed?

>ruby generate_patients.rb
generate_patients.rb:1:in `require': no such file to load -- nokogiri (LoadError)

Thanks.

@mayerm94
Copy link
Contributor

Ganesh,

For cqm-models we target ruby version 2.6.3. The current version of CQM-Models contains models for QDM 5.4 by default so you shouldn’t have to run the models generator unless you want to use a different version of QDM.

The PatientGenerator class is not intended to be run the way you are trying to run it. The PatientGenerator class contains helpful methods that will return data elements or patients with dataelements populated with random data. You can look at these methods to figure out how to use the models and populate the with your own data, or call these methods from your own program if you want to use QDM patients or data elements that do not contain meaningful QDM data.

-Matt

@ramanathanga
Copy link
Author

Hi Matt,

We were able to generate data in JSON format, pasted a snippet of that as below, using QDM 5.4 model info by default.
We see OID and HQMFOID in the generated data, would you be able to tell us what is the use of these attributes and what are they referring to? Is it a reference to any Database like MongoDB? Could we generate the data without OID and HQMFOID in the generated patient data?

In Parallel, We are also trying to generate data for QDM 5.3, would you be able to provide any references to "oids_qdm_5.4.json" for 5.3

If we have to change any defaults, would this be the right file to change the values?
/server/userhomedir/userid/cqm-models/lib/app/models/qdm/patient_characteristic_sex.rb as an example.

What is the use of CQM model libraries "/server/userhomedir/userid/cqm-models/app/models/cqm" used in patient generator - are these libraries required if we have to generate data only for QDM 5.3/5.4 NCQA Measures (non CMS measures)?

{"_id":{"$oid":"5d1b6a4195c87377b581e3c2"},"bundleId":null,"expectedValues":null,"familyName":"Participation Test Patient","givenNames":["Participation"],"measure_ids":null,"notes":null,"provider_ids":[],"qdmPatient":{"_id":{"$oid":"5d1b6a4195c87377b581e3c3"},"birthDatetime":"2018-12-31T19:00:00.000-05:00","dataElements":[{"_id":{"$oid":"5d1b6a4195c87377b581e2af"},"codeListId":null,"dataElementCodes":[{"code":"1234","codeSystem":"SNOMEDCT","descriptor":null,"codeSystemOid":null,"version":null,"_type":"QDM::Code"}],"description":null,"hqmfOid":"2.16.840.1.113883.10.20.28.4.55","id":{"_id":{"$oid":"5d1b6a4195c87377b581e3c4"},"namingSystem":null,"qdmVersion":"5.4","value":"5d1b6a4195c87377b581e2af"},"qdmCategory":"patient_characteristic","qdmStatus":"gender","qdmTitle":"Patient Characteristic Sex","qdmVersion":"5.4"},{"_id":{"$oid":"5d1b6a4195c87377b581e2b0"},"codeListId":null,"dataElementCodes":[{"code":"1234","codeSystem":"SNOMEDCT","descriptor":null,"codeSystemOid":null,"version":null,"_type":"QDM::Code"}],"description":null,"hqmfOid":"2.16.840.1.113883.10.20.28.4.59","id":{"_id":{"$oid":"5d1b6a4195c87377b581e3c5"},"namingSystem":null,"qdmVersion":"5.4","value":"5d1b6a4195c87377b581e2b0"},"qdmCategory":"patient_characteristic","qdmStatus":"race","qdmTitle":"Patient Characteristic Race","qdmVersion":"5.4"},{"_id":{"$oid":"5d1b6a4195c87377b581e2b1"},"codeListId":null,"dataElementCodes":[{"code":"1234","codeSystem":"SNOMEDCT","descriptor":null,"codeSystemOid":null,"version":null,"_type":"QDM::Code"}],"description":null,"hqmfOid":"2.16.840.1.113883.10.20.28.4.56","id":{"_id":{"$oid":"5d1b6a4195c87377b581e3c6"},"namingSystem":null,"qdmVersion":"5.4","value":"5d1b6a4195c87377b581e2b1"},"qdmCategory":"patient_characteristic","qdmStatus":"ethnicity","qdmTitle":"Patient Characteristic Ethnicity","qdmVersion":"5.4"},{"_id":{"$oid":"5d1b6a4195c87377b581e2b2"},"birthDatetime":"2018-12-31T19:00:00.000-05:00","codeListId":null,"dataElementCodes":[{"code":"1234","codeSystem":"SNOMEDCT","descriptor":null,"codeSystemOid":null,"version":null,"_type":"QDM::Code"}],"description":null,"hqmfOid":"2.16.840.1.113883.10.20.28.4.54","id":{"_id":{"$oid":"5d1b6a4195c87377b581e3c7"},"namingSystem":null,"qdmVersion":"5.4","value":"5d1b6a4195c87377b581e2b2"},"qdmCategory":"patient_characteristic","qdmStatus":"birthdate","qdmTitle":"Patient Characteristic Birthdate","qdmVersion":"5.4"},{"_id":{"$oid":"5d1b6a4195c87377b581e2b3"},"codeListId":null,"dataElementCodes":[{"code":"1234","codeSystem":"SNOMEDCT","descriptor":null,"codeSystemOid":null,"version":null,"_type":"QDM::Code"}],"description":null,"hqmfOid":"2.16.840.1.113883.10.20.28.4.130","id":{"_id":{"$oid":"5d1b6a4195c87377b581e3c8"},"namingSystem":null,"qdmVersion":"5.4","value":"5d1b6a4195c87377b581e2b3"},"participationPeriod":{"low":"2018-01-01T00:00:00.000+00:00","high":"2019-01-01T00:00:00.000+00:00","lowClosed":true,"highClosed":true},"qdmCategory":"participation","qdmTitle":"Participation","qdmVersion":"5.4"}],"extendedData":{"medical_record_number":"1"},"qdmVersion":"5.4"}},

@ramanathanga
Copy link
Author

Hi Matt,

We were able to successfully generate patient data for QDM modelinfo v5.4 but facing issues while trying to generate patient data for QDM v5.3. Following are couple of ways we did.

We are getting following error when we try to generate patient data (after generating models with QDM 5.3 modelinfo). Can you pls help.

patient_data = QDM::PatientGeneration.generate_exhastive_data_element_patients(false, 'qdm-modelinfo-5.3.xml'); puts "#{patient_data.to_json}"

  1. Generated models with QDM modelinfo v5.3 and then tried to generate patient data but could see following mismatch error for Ratio class.

[server@server lib]$ ruby23 patient_execute_qdm53.rb /midnas01/userhomedir/server/cqm-models/app/models/qdm/ratio.rb:3:inmodule:QDM': superclass mismatch for class Ratio (TypeError)
from /midnas01/userhomedir/server/cqm-models/app/models/qdm/ratio.rb:1:in <top (required)>' from /midnas01/userhomedir/server/cqm-models/app/models/models.rb:39:in require_relative'
from /midnas01/userhomedir/server/cqm-models/app/models/models.rb:39:in <top (required)>' from /midnas01/userhomedir/server/cqm-models/lib/generate_patients_all.rb:2:in require_relative'
from /midnas01/userhomedir/server/cqm-models/lib/generate_patients_all.rb:2:in <top (required)>' from /opt/rh/rh-ruby23/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in require'
from /opt/rh/rh-ruby23/root/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in require' from patient_execute_qdm53.rb:1:in

'
`

Looks like we shouldn't be generating models again with QDM 5.3 modelinfo. So I re-ran bin/validate_genererator.sh and ran lib/patient_execute_qdm53.rb

  1. Re-generated models using QDM v5.4 and ran patient_execute to generate patient data but could see parameters denominator/numerator not passed ot Ratio initialize method.

[server@server lib]$ ruby23 patient_execute_qdm53.rb /midnas01/userhomedir/server/cqm-models/app/models/qdm/basetypes/ratio.rb:7:ininitialize': wrong number of arguments (given 0, expected 2) (ArgumentError)
from /midnas01/userhomedir/server/cqm-models/lib/generate_patients_all.rb:64:in new' from /midnas01/userhomedir/server/cqm-models/lib/generate_patients_all.rb:64:in generate_loaded_datatype'
from /midnas01/userhomedir/server/cqm-models/lib/generate_patients_all.rb:34:in block in generate_exhastive_data_element_patients' from /midnas01/userhomedir/server/cqm-models/lib/generate_patients_all.rb:17:in each'
from /midnas01/userhomedir/server/cqm-models/lib/generate_patients_all.rb:17:in generate_exhastive_data_element_patients' from patient_execute_qdm53.rb:4:in

'
`

Sent with GitHawk

@shardulbanker
Copy link

Hi @ramanathanga,

Could you please tell how you are able to generate patient data for QDM 5.4 model version? Are you able to any new patients with this version?

Please help to clarify. We have C-CDA XML file with patient data, Is there any way we can generate it based on QDM 5.4?

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants