README.md in cqm-parsers-0.2.4 vs README.md in cqm-parsers-2.0.0

- old
+ new

@@ -1,14 +1,53 @@ +[![Build Status](https://travis-ci.com/projecttacoma/cqm-parsers.svg?branch=master)](https://travis-ci.com/projecttacoma/cqm-parsers) [![codecov](https://codecov.io/gh/projecttacoma/cqm-parsers/branch/master/graph/badge.svg)](https://codecov.io/gh/projecttacoma/cqm-parsers) +[![Gem Version](https://badge.fury.io/rb/cqm-parsers.svg)](https://badge.fury.io/rb/cqm-parsers) +# cqm-parsers -cqm-parsers -=========== +This project contains libraries for parsing HQMF documents and parsing MAT packages. -This project contains libraries for parsing HQMF documents. +## Usage (MAT Package Loading) -License -======= +To load measures from a MAT package file into the measure model, use the `Measures::CqlLoader` class. It can be used to create an array of measure models. For a composite measure, the array will contain the component measures and the last element will be the composite measure. For a non-composite measure (most measures), the array will contain one item. +Example measure loading: + +```ruby + +# Set the VSACValueSetLoader options; in this example we are fetching a specific profile. +vsac_options = { profile: 'MU2 Update 2016-04-01' } + +# Set the measure details. For defaults, you can just pass in {}. +measure_details = { 'episode_of_care'=> false } + +# Load a MAT package from test fixtures. +measure_file = File.new File.join('some/path/CMS158_v5_4_Artifacts.zip') + +# Initialize a value set loader, in this case we are using the VSACValueSetLoader. +value_set_loader = Measures::VSACValueSetLoader.new(vsac_options, get_ticket_granting_ticket) + +# Initialize the CqlLoader with the needed parameters. +loader = Measures::CqlLoader.new(measure_file, measure_details, value_set_loader) +# Build an array of measure models. +measures = loader.extract_measures + +``` + +Note that a different value set loader could be passed in; for example if you had a file containing value sets you could create a loader that read the value sets from file instead of fetching them from VSAC. + +## Running the tests + +```bash + +bundle exec rake test + +``` + +## Versioning + +We use [SemVer](http://semver.org/) for versioning. For the versions available, see [tags on this repository](https://github.com/projecttacoma/cqm-parsers/tags). + +## License Copyright 2018 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.