Git Product home page Git Product logo

health-data-standards's Introduction

This is a project to generate and consume HITSP C32, QRDA Category I, and QRDA Category III.

In addition this project also contains libraries for parsing HQMF documents and for dealing with NLM valuesets.

Environment

This project currently uses Ruby 2.0.0, Ruby 2.1.1, Ruby 2.2.1, and JRuby 1.7.11 and is built using Bundler. To get all of the dependencies for the project, first install bundler:

gem install bundler

Then run bundler to grab all of the necessary gems:

bundle install

The Quality Measure engine relies on a MongoDB MongoDB running a minimum of version 2.4.* or higher. To get and install Mongo refer to:

http://www.mongodb.org/display/DOCS/Quickstart

Project Practices

Please try to follow the GitHub Coding Style Guides. Additionally, we are switching to the git workflow described in Juan Batiz-Benet's Gist. If you are new to the project and would like to make changes, please fork and do your work in a feature branch. Submit a pull request and we'll check to see if it is suitable to be merged in.

Change Log

4.0.0 - Not yet released

  • Upgrading to mongoid 4

  • 3.6.0

  • Support for QRDA Cat I R3

  • Additional validators for QRDA Cat I/III

  • Removed GC32 & CCR code

  • Support latest QDM changes

  • Additional support for running in JRuby

3.5.3 - January 20, 2015

  • Support for 2014 QRDA Errata Release

3.4.6 - May 15, 2014

  • QRDA Cat I export now exports medical record number if present
  • Measures can now generate prefilter queries to be passed to MongoDB before CQM MapReduce jobs
  • BulkRecordImporter now handles JSON records and has better error handling
  • Bug fix - QRDA Cat III export uses correct XML element name for representedCustodianOrganization
  • Bug fix - QRDA Cat III export now properly represents CV measures
  • Bug fix - QRDA Cat I import now properly stores procedure performed ordinality
  • Bug fix - InsuranceProvider model included ThingsWithCodes twice

3.4.5 - April 4, 2014

  • Performance improvements in all exports through template caching
  • QRDA Cat I export now exports the record's actual address if present
  • QRDA Cat I export - Bug fix - previously patients with a race but no ethnicity would cause exceptions
  • QRDA Cat I import - performance improvements through more efficient XPath expressions

3.4.4 - March 25, 2014

  • Updating the Measure model to deal with continuous variable and NQF and CMS ids through Measure.categories
  • Bug fix - Filters were not properly handled by the QueryCache
  • Bug fix - Fixed the order of populations in HQMF::PopulationCriteria::ALL_POPULATION_CODES so that DENEX is after denominator
  • When importing measure bundles, you can now exclude patients and calculation results

3.4.3 - March 6, 2014

  • Implemented support for providers in QRDA Cat III documents
  • Now handles null value HQMF expression value types

3.4.2 - February 28, 2014

  • Provider improvements
    • Providers are now exported in QRDA Cat I if they exist on the Record object
    • Provider identifiers are now represented with CDAIdentifiers
    • Provider import will now import any type of identifier
    • Providers can now be arranged in a hierarchy
    • When importing providers from a clinical document, matching to existing providers in MongoDB has been improved to matching on any type of identifier
  • QRDA Cat I importer now imports procedure values regardless of whether the template has them at the root level or nested in an entryRelationship
  • Bug fix - Result importer will no longer double import result values
  • QRDA Cat I importer now imports encounter order end times
  • Bug fix - QRDA Cat I importer now properly imports condition and procedure ordinaltiy

3.4.1 - January 24, 2014

  • Fix for JRuby - Nokogiri is now fixed to version 1.6.0 exactly. Version 1.6.1 was breaking the CCR part of the test suite under JRuby. Nokogiri 1.6.0 works properly across Ruby 1.9.3, Ruby 2.0.0 and JRuby 1.7.9

3.4.0 - January 23, 2014

  • New Feature - BulkRecordImporter class now available that provides the ability to import QRDA Cat I, Consolidated CDA and HITSP C32
  • TemplateHelper now properly accepts a different directory for templates
  • QRDA Cat I importer now extracts negation on procedures
  • Implemented support to encounter transfers in QRDA Cat I import and export
  • Fixed bug where clinical trial participant would always return true on Record
  • QRDA Cat I importer now extracts ordinality and values from procedures
  • Better de-duplicating of data elements imported from QRDA Cat I
  • CDA importers now handle removal time on medical equipment
  • QRDA Cat I exporter now handles 38 week gestational period
  • Stratification fixes for QRDA Cat III export
  • QRDA Cat I importer now extracts incision date/time from procedure performed templates
  • CDA importers set admit times on encounters
  • QRDA Cat I diagnostic study order and procedure order importer now better handles order time for CQM calculation

3.3.0 - November 7, 2013

  • Removing hardcoded headers in QRDA documents and replacing them with templates populated by Ruby objects
  • XML structural fixes in QRDA Category III generation
  • QRDA Category I generation was previously dependent on a patient being associated with a bundle id, it will now use the latest bundle if one is not provided
  • Specified a version in our dependency on rubyzip. API changes in rubyzip were breaking our code
  • Fixed discrepancies between our Measure model and the JSON representation provided in measure bundles

3.2.11 - September 4, 2013

  • Adding rake tasks for working with measure bundles
  • Fixes for XPath expression execution when using JRuby
  • OID fixes for ordinality in QRDA Category

3.2.8 - August 23, 2013

  • Bug fixes for QRDA Category III generation
  • Import for insurance providers from QRDA Category I documents
  • Consolidated code for dealing with code system names

License

Copyright 2014 The MITRE Corporation

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

health-data-standards's People

Contributors

abgoldstein avatar adongare avatar andrequina avatar c-monkey avatar carpeliam avatar casey-erdmann avatar cmoesel avatar d-ross avatar dczulada avatar dehall avatar edeyoung avatar eedrummer avatar elehner avatar ewhitley avatar gavin-black avatar hadleynet avatar holmesie avatar hossenlopp avatar i2amsam avatar jletourneau80 avatar jtferns avatar mulcahyk avatar nonlinearity avatar pelargir avatar pkmitre avatar rdingwell avatar snosrap avatar ssayer avatar tstrass avatar xodarap avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

health-data-standards's Issues

'nil' error on 'numerator' inside of QRDA Cat3 `_performance_rate` partial

When I import the sample measures (v2.3) and sample patient data from Project Cypress into a popHealth instance using health-data-standards (3.2.7) and try to run a QRDA Cat3 export against the sample data it dies on the following line:

https://github.com/projectcypress/health-data-standards/blob/master/templates/cat3/_performance_rate.cat3.erb#L10

with an error indicating that I'm calling id on nil, which in this case means my aggregate_count.numerator object is nil.

In my sample instance I slightly modified this line for debugging to output aggregate_count.numerator every time this code is called and it indicates that the numerator is always nil.

Any idea why? Is it most likely something in the data, in the date range, in the patient data, or could this line of code be pulling the wrong object or was it perhaps built against a previous version of the QRDA Cat3 specification?

QRDA-1: CMS68v6 > Procedures > Not Done

Hi, QRDA-1 Cypress given Patient data missing Procedures. Please check attached xml, it should give procedures data but its not. See entry

<entry>
  <procedure classCode="PROC" moodCode="EVN" negationInd="true">
    <!--  Procedure performed template -->
    <templateId root="2.16.840.1.113883.10.20.24.3.64" extension="2016-02-01"/>
    <!-- Procedure Activity Procedure-->
    <templateId root="2.16.840.1.113883.10.20.22.4.14" extension="2014-06-09"/>
    <id root="1.3.6.1.4.1.115" extension="598b6d12636239085b3738ef"/>
    <code nullFlavor="NA" sdtc:valueSet="2.16.840.1.113883.3.600.1.462"/>
    <text>Procedure, Performed: Current Medications Documented Snmd</text>
    <statusCode code="completed"/>
    <effectiveTime>
      <low value="20150301160000"/>
      <high value="20150301160000"/>
    </effectiveTime>
    
    <entryRelationship typeCode="RSON">
  <observation classCode="OBS" moodCode="EVN">
    <templateId root="2.16.840.1.113883.10.20.24.3.88" extension="2014-12-01"/>
    <id root="1.3.6.1.4.1.115" extension="E02C3F9B677C6C8A53AAF5360E113086"/>
    <code code="77301-0" codeSystem="2.16.840.1.113883.6.1" displayName="reason" codeSystemName="LOINC"/>
    <statusCode code="completed"/>
      <effectiveTime>
        <low value="20150301160000"/>
      </effectiveTime>
    <value xsi:type="CD" code="183932001" codeSystem="2.16.840.1.113883.6.96" sdtc:valueSet="2.16.840.1.113883.3.600.1.1502"/>
  </observation>
</entryRelationship>


  </procedure>
</entry>

46_Ricky_Graham.txt

Any help would be appreciated, thanks

CAT3 export: manufacturerModelName

In the HL7 spec regarding the assignedAuthoringDevice element, there's no mention of a manufacturerModelName element, but both the template that generates this, and the Cypress 2.4.0 schema expect it to show up before the softwareName element if it's going to be there.

Assuming that we're trying to get health-data-standards to match the Cypress schema, since that's the certification tool?

License missing from gemspec

RubyGems.org doesn't report a license for your gem. This is because it is not specified in the gemspec of your last release.

via e.g.

spec.license = 'MIT'
# or
spec.licenses = ['MIT', 'GPL-2']

Including a license in your gemspec is an easy way for rubygems.org and other tools to check how your gem is licensed. As you can imagine, scanning your repository for a LICENSE file or parsing the README, and then attempting to identify the license or licenses is much more difficult and more error prone. So, even for projects that already specify a license, including a license in your gemspec is a good practice. See, for example, how rubygems.org uses the gemspec to display the rails gem license.

There is even a License Finder gem to help companies/individuals ensure all gems they use meet their licensing needs. This tool depends on license information being available in the gemspec. This is an important enough issue that even Bundler now generates gems with a default 'MIT' license.

I hope you'll consider specifying a license in your gemspec. If not, please just close the issue with a nice message. In either case, I'll follow up. Thanks for your time!

Appendix:

If you need help choosing a license (sorry, I haven't checked your readme or looked for a license file), GitHub has created a license picker tool. Code without a license specified defaults to 'All rights reserved'-- denying others all rights to use of the code.
Here's a list of the license names I've found and their frequencies

p.s. In case you're wondering how I found you and why I made this issue, it's because I'm collecting stats on gems (I was originally looking for download data) and decided to collect license metadata,too, and make issues for gemspecs not specifying a license as a public service :). See the previous link or my blog post about this project for more information.

Handle locations

I'm interested in using popHealth to create location-level QRDA-III documents. It seems like when popHealth calls into health-data-standards after doing a location-level aggregation, it passes a null providers array. So one way of handling this is to change this branch in _providers.cat3.erb:

 <% if providers.empty? -%>
    <!-- No provider data found in the patient record
         putting in a fake provider -->
      ...

I can submit a pull request with this change, but I wanted to get feedback from others on the project about whether this is the right path. Is this the right thing to do? Should I pass in a location variable or modify the providers array somehow? Just have a default in the config file and not actually pass stuff between popHealth and hds? Other ideas?

Is hqmf1.xml retired?

Hi ,

Would like to know if hqmf1.xml is retired in health-data-standards version 3.6.1?
My code is referring to template Ids for data_criterias mentioned in hqmf1.xml of version 2.4.0.
Should I be replacing all my old templateIds of all data_criteria to refer to hqmf2.xml's templateIds from 3.6.1 version?

Basic use documentation

Found this gem when trying to investigate CDA parsing options outside of pure nokogiri. This gem seems very useful but there seems to be no documentation or examples anywhere on how to use it. Producing some documentation would be helpful.

Rails 4.2?

Trying to bundle install into Rails 4.2 app, but there are many conflicts. Is there a branch that supports this Rails version?

CMS IG

Is there interest in a setting to use the CMS implementation guide? My guess is that most people using this library want to use it for Medicare reporting purposes.

bundle-latest.zip no longer exists on the new demo server

The code here defaults to a file that does not exist on the new demo server.

bundle_version = ENV["version"] || "latest"

https://github.com/projectcypress/health-data-standards/blob/04efeebbc9b99d6d8d7a917ff85f1a4ba225fed6/lib/health-data-standards/tasks/bundle.rake#L48

This is a 404 now.

https://cypressdemo.healthit.gov/measure_bundles/bundle-latest.zip

On the previous demo server this behavior worked as expected.

I am not sure what the expected behavior should be. The file should exist or the version should be required?

Health-data-standards crash on encounters without discharge dispositions

When trying to upload a file in popHealth with an encounter section but no dischargeDispositionCode, I get this error:

Nokogiri::XML::XPath::SyntaxError (Undefined namespace prefix: ./sdtc:discharge\DispositionCode): lib/record_importer.rb:64:in `import' app/controllers/admin_controller.rb:42:in`block (2 levels) in upload_patients' app/controllers/admin_controller.rb:39:in `each' app/controllers/admin_controller.rb:39:in`block in upload_patients' app/controllers/admin_controller.rb:38:in `upload_patients'

It seems to be coming from this line in health-data-standards:

encounter.discharge_disposition = extract_code(parent_element, "./sdtc:dischargeDispositionCode")

Encounters MAY contain [0..1] dischargeDispositionCodes, so the lack of a dischargeDispositionCode shouldn't be a fatal error.

HealthDataStandards::Export::Cat1

Is this class even viable anymore (in version 3.7.0)?

I have imported patients and Cat3 export functions as expected but Cat1 export fails to produce any entries in Patient Data section.

I traced the problem to the measure class having no data_criteria. So I rewrote the all_data_criteria function to return the data_criteria from the hqmf_document and got results (after fixing several errors in related .erb files)

Now I am finding various other issues with missing / incorrect entry exports.
I am beginning to think that this is a dead class and I am wasting my time.

Is this the case?

Generate a QRDA1 from CCDA file?

Looking for guidance on how to use this project to convert generate/export a QRDA1 from a CCDA. It seems like it's possible from the README, but I couldn't find any documentation on how to do so.

CAT3 export: Extra 'id' element

Measure NQF_ID: 0004

Cypress error: Element '{urn:hl7-org:v3}id': This element is not expected. Expected is one of ( {urn:hl7-org:v3}realmCode, {urn:hl7-org:v3}typeId, {urn:hl7-org:v3}templateId, {urn:hl7-org:v3}representedCustodianOrganization ).

Proposed change: It appears that https://github.com/projectcypress/health-data-standards/blob/develop/templates/cat3/show.cat3.erb#L44 outputs an extra id element that is simply incorrect and should be removed

Supporting references:

Any relation to 2015 CEHRT?

Hello, sorry if this question is too basic, but does this software implement any portion of the 2015 CEHRT, or does it actually relate to that in any way?

Question about the hqmf-generator

Hello,

I would like to use the hqmf-generator.
Can you give me an example of how to use it?

I have seen that there are several .erb documents, for every part of the document, like population criteria.erb, data criteria.erb etc.

My question is what kind of parameters should I give to generate an hqmf.xml file?
In the ErbContext, I have seen that there is initialization of some vars, but I can not figure out what kind of parameters I should give to produce a HQMF file.

Thank you in advance

How to pass in "codes" when parsing HQMF R1 files

I get the following messages when parsing a HQMF R1 file, for example CMS60v2.xml (from USHIK/CMS):

  • Codes not passed in, cannot backfill properties like gender
  • no code set to back fill: Clinical Trial Participant
  • no code set to back fill: Clinical Trial Participant
  • no code set to back fill: Clinical Trial Participant
  • no code set to back fill: birth date
  • no code set to back fill: birth date
  • no code set to back fill: Clinical Trial Participant
  • no code set to back fill: Clinical Trial Participant
  • (0164)codes are nil!!!!!!!!!!!

I have traced these messages back to https://github.com/projectcypress/health-data-standards/blob/7896e22444f8ff51f5c5dbca4c12cb5be7c03e11/lib/hqmf-parser/converter/pass1/document_converter.rb and https://github.com/projectcypress/health-data-standards/blob/7896e22444f8ff51f5c5dbca4c12cb5be7c03e11/lib/hqmf-parser/parser.rb

Are "codes" another name for value sets/concepts? Is there an example of how to parse HQMF R1 with this library while providing "codes"?

Thanks in advance!

Test failures for cat_1 test

I'm trying to run the Cat 1 export test test/unit/export/cat_1_test.rb and I'm getting test failures.

$ ruby test/unit/export/cat_1_test.rb
Started with run options --seed 12363

Cat1Test
  test_record_target_export                                       PASS (0.64s)
  test_payer_information                                          PASS (0.64s)
  test_unique_data_criteria                                       PASS (0.70s)
  test_reporting_parameters_section_export                        PASS (0.62s)
Testing Cat I for Barry Berry
Testing Cat I for Mary Berry
  test_schematron_r2_validation                                   FAIL (6.39s)
Minitest::Assertion:         Invalid Cat I for Mary Berry (with header).
        --- expected
        +++ actual
        @@ -1 +1 @@
        -[]
        +[#<ValidationError:0xXXXXXX @location="/*[local-name()='ClinicalDocument' and namespace-uri()='urn:hl7-org:v3']/*[local-name()='component' and namespace-uri()='urn:hl7-org:v3']/*[local-name()='structuredBody' and namespace-uri()='urn:hl7-org:v3']/*[local-name()='component' and namespace-uri()='urn:hl7-org:v3'][3]/*[local-name()='section' and namespace-uri()='urn:hl7-org:v3']", @message="SHALL contain at least one [1..*] entry (CONF:14567).", @validator="QRDA Cat 1 Validator", @file_name="cat1_good.xml">]
        test/unit/export/cat_1_test.rb:78:in `block in test_schematron_r2_validation'
        /Users/pairing/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/mongoid-4.0.0/lib/mongoid/contextual/mongo.rb:648:in `yield_document'
        /Users/pairing/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/mongoid-4.0.0/lib/mongoid/contextual/mongo.rb:123:in `block in each'
        /Users/pairing/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/moped-2.0.7/lib/moped/cursor.rb:29:in `block in each'
        /Users/pairing/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/moped-2.0.7/lib/moped/cursor.rb:29:in `each'
        /Users/pairing/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/moped-2.0.7/lib/moped/cursor.rb:29:in `each'
        /Users/pairing/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/moped-2.0.7/lib/moped/query.rb:78:in `each'
        /Users/pairing/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/mongoid-4.0.0/lib/mongoid/contextual/mongo.rb:122:in `each'
        /Users/pairing/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/mongoid-4.0.0/lib/mongoid/contextual.rb:20:in `each'
        test/unit/export/cat_1_test.rb:67:in `test_schematron_r2_validation'

  test_entries_for_data_criteria                                  FAIL (0.72s)
Minitest::Assertion:         Expected: 1
          Actual: 0
        test/unit/export/cat_1_test.rb:105:in `test_entries_for_data_criteria'

  test_patient_data_section_export                                FAIL (0.67s)
Minitest::Assertion:         med_dispensed is nil
        test/unit/export/cat_1_test.rb:95:in `test_patient_data_section_export'

Testing Cat I for Barry Berry
Testing Cat I for Mary Berry
  test_schematron_validation                                      FAIL (7.30s)
Minitest::Assertion:         Invalid Cat I for Mary Berry (with header).
        --- expected
        +++ actual
        @@ -1 +1 @@
        -[]
        +[#<ValidationError:0xXXXXXX @location="/*[local-name()='ClinicalDocument' and namespace-uri()='urn:hl7-org:v3']/*[local-name()='component' and namespace-uri()='urn:hl7-org:v3']/*[local-name()='structuredBody' and namespace-uri()='urn:hl7-org:v3']/*[local-name()='component' and namespace-uri()='urn:hl7-org:v3'][3]/*[local-name()='section' and namespace-uri()='urn:hl7-org:v3']", @message="SHALL contain at least one [1..*] entry (CONF:14567).", @validator="QRDA Cat 1 R3 Validator", @file_name="cat1_good.xml">]
        test/unit/export/cat_1_test.rb:60:in `block in test_schematron_validation'
        /Users/pairing/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/mongoid-4.0.0/lib/mongoid/contextual/mongo.rb:648:in `yield_document'
        /Users/pairing/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/mongoid-4.0.0/lib/mongoid/contextual/mongo.rb:123:in `block in each'
        /Users/pairing/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/moped-2.0.7/lib/moped/cursor.rb:29:in `block in each'
        /Users/pairing/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/moped-2.0.7/lib/moped/cursor.rb:29:in `each'
        /Users/pairing/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/moped-2.0.7/lib/moped/cursor.rb:29:in `each'
        /Users/pairing/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/moped-2.0.7/lib/moped/query.rb:78:in `each'
        /Users/pairing/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/mongoid-4.0.0/lib/mongoid/contextual/mongo.rb:122:in `each'
        /Users/pairing/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/mongoid-4.0.0/lib/mongoid/contextual.rb:20:in `each'
        test/unit/export/cat_1_test.rb:49:in `test_schematron_validation'

Testing Cat I for Barry Berry
Testing Cat I for Mary Berry
Testing Cat I for Rosa Vasquez
  test_schema_validation                                          PASS (0.87s)
  test_handling_expired_patients                                  PASS (0.67s)
  test_cda_header_export                                          PASS (0.63s)
  test_measure_section_export                                     PASS (0.58s)

Finished in 20.44585s
12 tests, 28 assertions, 4 failures, 0 errors, 0 skips

I'm using Ruby 2.2.1 and mongo 3.4.4.

Need to specify a version of rubyzip in the gemspec

We don't specify the version of rubyzip we are using in our gemspec. Our code currently works with rubyzip 0.9.9, but breaks on versions greater than 1.0.0. We should upgrade to the latest version of rubyzip and specify a version number.

continuous variable value, element 'entryRelationship' should have attribute 'typeCode'

The attribute is currently 'type'

https://github.com/projectcypress/health-data-standards/blob/develop/templates/cat3/_continuous_variable_value.cat3.erb#L1

but should be 'typeCode'

Cypress:

https://github.com/projectcypress/cypress/blob/master/resources/schematron/qrda/qrda_cat_3/QRDA_Category_III.sch#L546

QRDA 3:
5.4 Measure Data
14. MAY contain zero or more [0..*] entryRelationship (CONF:18143) such that it
a. SHALL contain exactly one [1..1] @typecode="COMP" (CodeSystem: HL7ActRelationshipType 2.16.840.1.113883.5.1002 STATIC) (CONF:18148).

Patient Importer - Comm from Provider to Provider - Wrong ID

In patient_importer.rb:
generate_importer(Cat1::ProcedureImporter, nil, '2.16.840.1.113883.3.560.1.129'), #comm from provider to provider

If I look at the spec, the code should be ...1.29 not ...1.129. There's an extra 1 in there.1.129is thenegation: trueversion ofcommunication_from_provider_to_provideraccording to thehqmf_template_oid_map`.

I think anyway :) If I'm wrong, please let me know why. FWIW, I had to edit my records documents in my DB to be 1.29 instead of 1.129 to pass Measure 0089 QRDA Cat I Test in Cypress.

Question - HQMF 2.1 Subsets and ""

Hello -

More of a question than an issue.

Some of the new EH measures released in May (EX: "EH_CMS190v4_NQF0372_VTE2/CMS190v4.xml") include excerpt entries that use sequenceNumber - no "subsetCode" entry.

The HQMF 2.x parser seems to want to have a type for these (https://github.com/projectcypress/health-data-standards/blob/7d49e1dd92815dd77b375a918b515c829a3a5a04/lib/hqmf-parser/2.0/types.rb#L183) "@type = attr_val('./cda:subsetCode/@code')"

In reading more of the documentation, there's a note that says "This representation aligns with the HQMF specification and does not require a subset operator."

The Data Criteria parser seems to attempt to create subset_operators for each "excerpt entry"
https://github.com/projectcypress/health-data-standards/blob/7d49e1dd92815dd77b375a918b515c829a3a5a04/lib/hqmf-parser/2.0/data_criteria.rb#L274

In the event that this is a sequence entry and does not contain a subsetCode, should we avoid creating a subset entry? Should the xpath in the data criteria parser only include entries that contain a subsetCode node?

Thank you,
Eric

Medication importer with Reason Underweight issue for measure CMS69 (CAT1)

I have an issue with a patient that should meet numerator for measure CMS69

cms65numerator

The patient has a Medication, Order: Below Normal Medications with Reason Underweight. (CAT1 file)

        <!-- ================= Medication Order template ================= -->
        <substanceAdministration classCode="SBADM" moodCode="RQO">
          <templateId extension="2014-06-09" root="2.16.840.1.113883.10.20.22.4.42"/>
          <!-- Medication, Order template -->
          <templateId extension="2016-02-01" root="2.16.840.1.113883.10.20.24.3.47"/>
          <id extension="Get Well Clinic-1-1372-2400-DF" root="2.16.840.1.113883.3.1452.3"/>
          <text>SIG information not entered</text>
          <statusCode code="completed"/>
          <effectiveTime xsi:type="IVL_TS">
            <low value="20170510235959"/>
            <high nullFlavor="UNK"/>
          </effectiveTime>
          <routeCode/>
          <doseQuantity nullFlavor="NA"/>
          <consumable>
            <manufacturedProduct classCode="MANU">
              <!-- Medication Information (consolidation) template -->
              <templateId extension="2014-06-09" root="2.16.840.1.113883.10.20.22.4.23"/>
              <id root="ba86866c-73ff-40cf-841d-26cfe8747a8f"/>
              <manufacturedMaterial>
                <code code="860221" codeSystem="2.16.840.1.113883.6.88" codeSystemName="RxNorm" sdtc:valueSet="2.16.840.1.113883.3.600.1.1499" xsi:type="CE">
                  <originalText>SIG information not entered</originalText>
                </code>
              </manufacturedMaterial>
            </manufacturedProduct>
          </consumable>
          <author>
            <templateId root="2.16.840.1.113883.10.20.22.4.119"/>
            <time value="20170510235959"/>
            <assignedAuthor>
              <id root="3fd83a53-d600-4fb6-99c6-60939e63e91e"/>
            </assignedAuthor>
          </author>
          <!-- ================= Reason template ================= -->
          <entryRelationship typeCode="RSON">
            <observation classCode="OBS" moodCode="EVN">
              <templateId extension="2014-12-01" root="2.16.840.1.113883.10.20.24.3.88"/>
              <id extension="7368fe92-7891-4b76-b65e-524c9ed59668" root="2.16.840.1.113883.3.1452.1011"/>
              <code code="77301-0" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" displayName="reason"/>
              <statusCode code="completed"/>
              <effectiveTime>
                <low value="20170510235959"/>
              </effectiveTime>
              <value code="248342006" codeSystem="2.16.840.1.113883.6.96" sdtc:valueSet="2.16.840.1.113883.3.600.2388" xsi:type="CD"/>
            </observation>
          </entryRelationship>
        </substanceAdministration>
      </entry>
      <entry>

I reviewed the class medication_importer.rb (health-data-standards/lib/health-data-standards/import/cda/medication_importer.rb) the method in charge of to extract the reason or negation is implemented the following way:

    def extract_reason_or_negation(parent_element, medication)
      negation_indicator = parent_element['negationInd']
      if negation_indicator.nil? && parent_element.parent.name == "entryRelationship"
        super(parent_element.parent.parent, medication, parent_element)
      elsif negation_indicator.eql?('true')
        super(parent_element, medication)
      end
    end

In my scenario the medication order doesn't have a negationInd=true and the parent_element.parent.name != "entryRelationship", when the method receives the medication order entry the method doesn't extract the reason.

I think, the issue could be solved if the method is changed of the following way:

    def extract_reason_or_negation(parent_element, medication)
      negation_indicator = parent_element['negationInd']
      if negation_indicator.nil? && parent_element.parent.name == "entryRelationship"
        super(parent_element.parent.parent, medication, parent_element)
      else
        super(parent_element, medication)
      end
    end

Please let me know if this is an issue or there is something wrong in my medication order entry.

Thanks in advance.

CDA extract_scalar doesnt play nice with floats

I recently noticed that when importing sections that have a scalar unit (such as the dosage for a medication) that the value is being converted to an integer.

It looks like the culprit is the to_i on line 193 of lib/health-data-standards/import/cda/section_importer.rb.

{'unit' => scalar_element['unit'], 'value' => scalar_element['value'].to_i}

Will it break anything if we change this to to_f instead?

NoMethodError when C32 file doesn't have patient element

PatientImporter#get_demographics blows up at line 130 when the C32 file being parsed doesn't have a "ClinicalDocument > recordTarget > patientRole > patient" element:

NoMethodError: undefined method `at_xpath' for nil:NilClass
    /Users/pelargir/.rvm/gems/ruby-2.0.0-p0/gems/health-data-standards-3.1.1/lib/health-data-standards/import/c32/patient_importer.rb:130:in `get_demographics'
    /Users/pelargir/.rvm/gems/ruby-2.0.0-p0/gems/health-data-standards-3.1.1/lib/health-data-standards/import/c32/patient_importer.rb:86:in `parse_c32'

This should instead be handled gracefully without throwing an exception.

Models should be namespaced

This gem defines dozens of models (most of them subclasses of Entry) but fails to namespace them within the HealthDataStandards. This means that my own application's Procedure, Provider, etc. classes get stepped on as soon as I import the gem.

+1 for properly namespacing these models.

question about field_value_helper.rb

In this particular file -> https://github.com/projectcypress/health-data-standards/blob/master/lib/hqmf-parser/2.0/field_value_helper.rb

I noticed that the file field_value_helper has the following method, using XPATH looking for typeCode="REFV"... should the XPATH be changed to typeCode="REFR"? I didn't notice that particular type code in the HQMF for the 2016 reporting year measures.

def self.parse_observation_fields(entry, fields) 
      parse_dset_cd(entry.at_xpath('./cda:methodCode', HQMF2::Document::NAMESPACES), 'METHOD', fields) 
      parse_dset_cd(entry.at_xpath('./cda:targetSiteCode', HQMF2::Document::NAMESPACES), 
                    'ANATOMICAL_LOCATION_SITE', fields) 
      parse_cd(entry.at_xpath("./cda:participation[@typeCode='SBJ']/cda:role[@classCode='PRS']/cda:code", 
                              HQMF2::Document::NAMESPACES), 
               'RELATIONSHIP', fields) 
      parse_pq(entry.at_xpath("./cda:outboundRelationship[@typeCode='REFV']/cda:observationCriteria/cda:value/cda:high", 
                              HQMF2::Document::NAMESPACES), 
               'REFERENCE_RANGE_HIGH', fields) 
      parse_pq(entry.at_xpath("./cda:outboundRelationship[@typeCode='REFV']/cda:observationCriteria/cda:value/cda:low", 
                              HQMF2::Document::NAMESPACES), 
               'REFERENCE_RANGE_LOW', fields) 
    end

Using without MongoDB

Hi, using to extract information from QRDA, CAT-1, able to extract Patient without MongoDB but when extracting provider_performances, its giving up error

Problem:
  No configuration could be found for a session named 'default'.
Summary:
  When attempting to create the new session, Mongoid could not find a session configuration for the name: 'default'. This is necessary in order to know the host, port, and options needed to connect.
Resolution:
  Double check your mongoid.yml to make sure under the sessions key that a configuration exists for 'default'. If you have set the configuration programatically, ensure that 'default' exists in the configuration hash.

using snippet from bulk_record_importer.rb and used CDA::ProviderImporter.instance.extract_providers for extraction.

Any help would be appreciated, thanks

HQMF parsing: possible to list data elements by location?

I'm wondering what the LOE/suggested course of implementing the following feature/output: I have a need to take a HQMF document, parse it, and, for each data element, see where in the population_criteria it exists (IPP, DENEX, NUMER, DENEXCEP, etc.). I know many data elements get used several times per measure.

Any guidance is much appreciated!

Thanks,

Mark

Encounter Performed Cat I template uses the wrong value set for transfers

When generating QRDA Cat I, the value set for the overall encounter is passed in to the code_display method for transfer from and transfer to. This causes problems on CQMs like CMS188 because the transfer value sets do not overlap with the encounter value set. This causes the code_display method to null flavor the code even if it is not part of the encounter value set.

Parser fix possibly not applied in rubygems 3.6.1

Using popHealth with 3.6.1 of the HDS gem from rubygems. When I try to upload the following HQMF definition using the UI:
BP_Test_v4_3_eMeasure.txt

It is failing to be recognized as a valid v2 HQMF document (V2Parser::valid? is returning false). There is a commit that addresses this, however it does not appear to be applied in the version pulled down from rubygems. I did "gem unpack" and confirmed the relevant change does not exist in lib/hqmf-parser/parser.rb.

If I change the popHealth Gemfile to pull from the master github branch of the HDS library, the error goes away. This is a reasonable workaround to proceed with. I just wanted to raise this to confirm others have seen something similar, and to see if HDS may need to be updated in rubygems.

Ruby 2.4

Please add Ruby 2.4 support.

This gem does not build with Ruby 2.4, due to out of date dependencies, and the deprecation of Fixnum and Bignum within Ruby 2.4.

Provided TIN not imported from qrda/cda in provider_importer.rb

In Cypress health-data-standards-1bb2d48cf24f (mongoid) at least, file path /lib/health-data-standards/import/cda/provider_importer.rb the provider NPI is extracted but not the provider TIN.

2016 C4 filter applications that use the health-data-standards library require the provider TIN.
It is possibly a one-line addition to extract_provider_data in HealthDataStandards::Import::CDA::ProviderImporter.

I'm not a Ruby-experienced, but I will try the change locally and report.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.