source stringclasses 1
value | repo stringlengths 5 63 | repo_url stringlengths 24 82 | path stringlengths 5 167 | language stringclasses 1
value | license stringclasses 5
values | stars int64 10 51.4k | ref stringclasses 23
values | size_bytes int64 200 258k | text stringlengths 137 258k |
|---|---|---|---|---|---|---|---|---|---|
github | projectcypress/cypress | https://github.com/projectcypress/cypress | app/models/multi_measure_test.rb | Ruby | apache-2.0 | 89 | master | 455 | # frozen_string_literal: true
class MultiMeasureTest < ProductTest
field :reporting_program_type, type: String
after_create do |product_test|
product_test.queued
ProductTestSetupJob.perform_later(product_test)
create_tasks
end
def create_tasks
MultiMeasureCat3Task.new(product_test: self).save... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | app/models/checklist_test.rb | Ruby | apache-2.0 | 89 | master | 6,010 | # frozen_string_literal: true
class ChecklistTest < ProductTest
include Cypress::DataCriteriaSelector
embeds_many :checked_criteria, class_name: 'ChecklistSourceDataCriteria'
accepts_nested_attributes_for :checked_criteria, allow_destroy: true
after_create do |checklist_test|
ChecklistTestSetupJob.perfor... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | app/models/task.rb | Ruby | apache-2.0 | 89 | master | 2,360 | # frozen_string_literal: true
class Task
include Mongoid::Document
include Mongoid::Timestamps
include GlobalID::Identification
field :options, type: Hash
field :expected_results, type: Hash
field :latest_test_execution_id, type: String
belongs_to :product_test, inverse_of: :tasks, touch: true
has_man... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | app/models/product_test.rb | Ruby | apache-2.0 | 89 | master | 16,831 | # frozen_string_literal: true
# rubocop:disable Metrics/ClassLength
class ProductTest
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::Attributes::Dynamic
include GlobalID::Identification
scope :by_updated_at, -> { order(updated_at: :desc) }
# TODO: Use real attributes?
scope :mea... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | app/models/cms_program_task.rb | Ruby | apache-2.0 | 89 | master | 7,073 | # frozen_string_literal: true
class CMSProgramTask < Task
include ::Validators
after_create :initialize_program_specific_fields
def validators
# Valiators that are common across all tests
@validators = [ProgramCriteriaValidator.new(product_test),
ProgramValidator.new([product_test.cm... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | app/models/c1_task.rb | Ruby | apache-2.0 | 89 | master | 2,107 | # frozen_string_literal: true
class C1Task < Task
include Mongoid::Attributes::Dynamic
# C1 = Record and Export
# - Record all the data needed to calculate CQMs
# - Export data as Cat 1
#
# Also, if the parent product test includes a C3 Task,
# do that validation here
def validators
@validators ... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | app/models/c3_cat3_task.rb | Ruby | apache-2.0 | 89 | master | 1,056 | # frozen_string_literal: true
class C3Cat3Task < Task
def validators
@validators = [::Validators::MeasurePeriodValidator.new,
::Validators::QrdaCat3Validator.new(product_test.expected_results, true, true, product_test.c2_test, product_test.bundle)]
cms_cat3_schematron_validator if product_... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | app/models/filtering_test.rb | Ruby | apache-2.0 | 89 | master | 1,874 | # frozen_string_literal: true
class FilteringTest < ProductTest
field :options, type: Hash
field :incl_addr, type: Boolean
field :display_name, type: String
accepts_nested_attributes_for :tasks
after_create :create_tasks
def create_tasks
tasks.build({ product_test: self }, Cat1FilterTask).save
ta... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | app/models/test_execution.rb | Ruby | apache-2.0 | 89 | master | 6,455 | # frozen_string_literal: true
class TestExecution
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::Attributes::Dynamic
include GlobalID::Identification
# include Cypress::ErrorCollector
field :state, type: Symbol, default: :pending
field :expected_results, type: Hash
field :repor... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | app/models/product.rb | Ruby | apache-2.0 | 89 | master | 10,816 | # frozen_string_literal: true
class Product
include Mongoid::Document
include Mongoid::Attributes::Dynamic
include Mongoid::Timestamps
before_save :enforce_duplicate_patient_settings
mount_uploader :supplemental_test_artifact, SupplementUploader
scope :by_updated_at, -> { order(updated_at: :desc) }
sc... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | app/models/c3_cat1_task.rb | Ruby | apache-2.0 | 89 | master | 2,136 | # frozen_string_literal: true
class C3Cat1Task < Task
def validators
# not using the "calculating" smoking gun validator here
# because we only want the record (patient) inclusion test from the regular version
@validators = [::Validators::SmokingGunValidator.new(product_test.measures, product_test.patien... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | app/models/vendor.rb | Ruby | apache-2.0 | 89 | master | 3,199 | # frozen_string_literal: true
class Vendor
include Mongoid::Document
include Mongoid::Attributes::Dynamic
include Mongoid::Timestamps
resourcify
scope :by_updated_at, -> { order(updated_at: :desc) }
has_many :products, dependent: :destroy
has_many :patients, dependent: :destroy, foreign_key: 'correlati... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | app/models/cat1_filter_task.rb | Ruby | apache-2.0 | 89 | master | 1,315 | # frozen_string_literal: true
class Cat1FilterTask < Task
include ::Validators
# C1 = Record and Export
# - Record all the data needed to calculate CQMs
# - Export data as Cat 1
#
# Also, if the parent product test includes a C3 Task,
# do that validation here
def validators
@validators = [::Vali... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | app/models/user.rb | Ruby | apache-2.0 | 89 | master | 3,984 | # frozen_string_literal: true
class User
include Mongoid::Document
rolify
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable,
... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | app/models/cms_program_test.rb | Ruby | apache-2.0 | 89 | master | 2,256 | # frozen_string_literal: true
class CMSProgramTest < ProductTest
field :cms_program, type: String
field :reporting_program_type, type: String
embeds_many :program_criteria, class_name: 'ProgramCriterion'
accepts_nested_attributes_for :program_criteria, allow_destroy: true
# List of cms programs
validates ... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | app/models/qrda_upload_task.rb | Ruby | apache-2.0 | 89 | master | 1,309 | # frozen_string_literal: true
class QrdaUploadTask < Task
include Mongoid::Attributes::Dynamic
include ActionView::Helpers::NumberHelper
include ::CqmValidators
field :year, type: String
field :qrda_type, type: String
field :organization, type: String
def validators
@validators = [::Validators::Qrd... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | app/models/c1_checklist_task.rb | Ruby | apache-2.0 | 89 | master | 925 | # frozen_string_literal: true
require 'validators/checklist_criteria_validator'
class C1ChecklistTask < Task
include Mongoid::Attributes::Dynamic
include ::Validators
# C1 = Record and Export
# - Record all the data needed to calculate CQMs
# - Export data as Cat 1
#
# Also, if the parent product tes... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | app/models/execution_error.rb | Ruby | apache-2.0 | 89 | master | 933 | # frozen_string_literal: true
class ExecutionError
include Mongoid::Document
include Mongoid::Attributes::Dynamic
embedded_in :test_execution
field :message, type: String
field :msg_type, type: Symbol
field :measure_id, type: String
field :validation_type, type: String
field :validator_type, type: Sym... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | app/models/program_criterion.rb | Ruby | apache-2.0 | 89 | master | 670 | # frozen_string_literal: true
class ProgramCriterion
include Mongoid::Document
field :criterion_key, type: String
field :criterion_name, type: String
field :criterion_description, type: String
field :criterion_xpath, type: String
field :cms_conf, type: String
field :entered_value, type: String
field :... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | app/models/cat3_filter_task.rb | Ruby | apache-2.0 | 89 | master | 1,678 | # frozen_string_literal: true
class Cat3FilterTask < Task
def validators
@validators = [::Validators::QrdaCat3Validator.new(product_test.expected_results,
false,
product_test.c3_test,
... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | app/models/checklist_source_data_criteria.rb | Ruby | apache-2.0 | 89 | master | 7,936 | # frozen_string_literal: true
class ChecklistSourceDataCriteria
include Mongoid::Document
include Mongoid::Attributes::Dynamic
include Mongoid::Timestamps
embedded_in :checklist_test
field :measure_id, type: String
field :source_data_criteria, type: Hash
field :replacement_data_criteria, type: String
... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | app/models/tracker.rb | Ruby | apache-2.0 | 89 | master | 791 | # frozen_string_literal: true
class Tracker
include Mongoid::Document
field :job_id
field :job_class, type: String
field :status, type: Symbol
field :log_message, type: Array, default: []
field :options, type: Hash, default: {}
scope :working, -> { where(status: :working) }
scope :failed, -> { where(s... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | app/models/multi_measure_cat1_task.rb | Ruby | apache-2.0 | 89 | master | 1,111 | # frozen_string_literal: true
class MultiMeasureCat1Task < Task
def validators
@validators = [::Validators::CalculatingSmokingGunValidator.new(product_test.measures, product_test.patients, product_test.id),
::Validators::MeasurePeriodValidator.new,
::Validators::CMSQRDA1HQRS... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | app/models/c2_task.rb | Ruby | apache-2.0 | 89 | master | 2,851 | # frozen_string_literal: true
require 'validators/qrda_cat3_validator'
class C2Task < Task
# C2 = Import and Calculate
# - Ability to Import Cat 1
# - Calculate every CQM
# - (implied) ability to export cat 3 (in order to be able to prove it)
#
# Also, if the parent product test includes a C3 Task,
#... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | app/models/point_of_contact.rb | Ruby | apache-2.0 | 89 | master | 1,235 | # frozen_string_literal: true
class PointOfContact
include Mongoid::Document
include Mongoid::Attributes::Dynamic
include Mongoid::Timestamps
include Mongoid::Changeable
embedded_in :vendor
validates :name, presence: true, uniqueness: true
field :name, type: String
field :email, type: String
field... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | script/generate_cat1_preference.rb | Ruby | apache-2.0 | 89 | master | 791 | # frozen_string_literal: true
require 'csv'
require 'json'
require 'yaml'
def vs_from_row(row)
vs_param = {}
vs_param['ValueSet'] = row['ValueSet']
vs_param['Weight'] = row['Weight']
vs_param['IsAttribute'] = row['IsAttribute'] == 'TRUE'
vs_param
end
previous_measure = nil
measures = {}
valuesets = []
csv_... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/bootstrap_breadcrumbs_builder.rb | Ruby | apache-2.0 | 89 | master | 1,378 | # frozen_string_literal: true
# The BootstrapBreadcrumbsBuilder is a Bootstrap compatible breadcrumb builder.
# It provides basic functionalities to render a breadcrumb navigation according to Bootstrap's conventions.
#
# Originally from https://gist.github.com/riyad/1933884/ modified for Bootstrap 3 and
# "Go to hell... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/cypress.rb | Ruby | apache-2.0 | 89 | master | 6,551 | # frozen_string_literal: true
require_relative 'hash'
require_relative 'api'
require_relative '../app/uploaders/document_uploader'
require_relative '../app/uploaders/patient_archive_uploader'
require_relative '../app/uploaders/supplement_uploader'
require_relative 'cypress/error_collector'
require_relative 'cypress/... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/hash.rb | Ruby | apache-2.0 | 89 | master | 267 | # frozen_string_literal: true
class Hash
def method_missing(sym)
if key?(sym.to_s)
self[sym.to_s]
elsif key?(sym)
self[sym]
else
super
end
end
def respond_to_missing?(method_name, include_private = false)
super
end
end |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/api.rb | Ruby | apache-2.0 | 89 | master | 3,941 | # frozen_string_literal: true
module Api
module Controller
def self.included(target)
name = target.controller_name
singular_name = name.singularize
singular_json_representer = make_singular_json_representer(singular_name)
plural_json_representer = make_plural_json_representer(singular_j... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/validators/qrda_upload_validator.rb | Ruby | apache-2.0 | 89 | master | 1,975 | # frozen_string_literal: true
# require "cypress/qrda_file_validator"
module Validators
class QrdaUploadValidator < QrdaFileValidator
include Validators::Validator
include ::CqmValidators
def initialize(year, qrda_type, organization)
bundle_year = year.to_i - 1
qrda_validator = case qrda_t... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/validators/checklist_criteria_validator.rb | Ruby | apache-2.0 | 89 | master | 8,678 | # frozen_string_literal: true
# require "cypress/qrda_file_validator"
module Validators
class ChecklistCriteriaValidator < QrdaFileValidator
include Validators::Validator
include ::CqmValidators
def initialize(checklist_test)
@bundle_id = checklist_test.bundle.id
@criteria_list = checklist_... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/validators/tin_validator.rb | Ruby | apache-2.0 | 89 | master | 1,285 | # frozen_string_literal: true
module Validators
class TinValidator < QrdaFileValidator
include Validators::Validator
def validate(file, options = {})
aco_measure_ids = Measure.where(hqmf_set_id: { '$in': APP_CONSTANTS['aco_measures_hqmf_set_ids'] }).distinct(:hqmf_id)
return unless aco_measure_i... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/validators/program_criteria_validator.rb | Ruby | apache-2.0 | 89 | master | 8,033 | # frozen_string_literal: true
# require "cypress/qrda_file_validator"
module Validators
class ProgramCriteriaValidator < QrdaFileValidator
include Validators::Validator
include ::CqmValidators
include QrdaHelper
def initialize(program_test)
@criteria_list = program_test.program_criteria
... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/validators/smoking_gun_validator.rb | Ruby | apache-2.0 | 89 | master | 4,194 | # frozen_string_literal: true
module Validators
class SmokingGunValidator
include Validators::Validator
include QrdaHelper
attr_accessor :measures, :test_id, :sgd, :records, :names, :expected_records, :can_continue
attr_reader :found_names
self.validator_type = :result_validation
self.valid... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/validators/ehr_certification_id_validator.rb | Ruby | apache-2.0 | 89 | master | 1,957 | # frozen_string_literal: true
# For MIPS submissions, CMS EHR Certification ID is only required if Promoting Interoperability performance category
# (Promoting Interoperability Section (V2) identifier: urn:hl7ii:2.16.840.1.113883.10.20.27.2.5:2017-06-01)
# is present in a QRDA III document.
module Validators
class E... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/validators/provider_type_validator.rb | Ruby | apache-2.0 | 89 | master | 1,845 | # frozen_string_literal: true
module Validators
class ProviderTypeValidator < QrdaFileValidator
include Validators::Validator
PROVIDER_TYPE_SELECTOR = '/cda:ClinicalDocument/cda:documentationOf/cda:serviceEvent/cda:performer/cda:assignedEntity/cda:code/@code'
def validate(file, options = {})
@doc... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/validators/qrda_cat1_validator.rb | Ruby | apache-2.0 | 89 | master | 3,057 | # frozen_string_literal: true
# require "cypress/qrda_file_validator"
module Validators
class QrdaCat1Validator < QrdaFileValidator
include Validators::Validator
include ::CqmValidators
def initialize(bundle, is_c3_validation_task, test_has_c3, test_has_c1, measures = [])
@test_has_c3 = test_has_... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/validators/qrda_file_validator.rb | Ruby | apache-2.0 | 89 | master | 683 | # frozen_string_literal: true
module Validators
class QrdaFileValidator
include Validators::Validator
self.validator_type = :result_validation
def get_document(doc)
doc = Nokogiri::XML(doc) if doc.is_a?(String)
raise ArgumentError, 'Argument was not an XML document' unless doc.root
d... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/validators/calculating_augmented_results.rb | Ruby | apache-2.0 | 89 | master | 1,825 | # frozen_string_literal: true
module Validators
# This is a set of helper methods to assist in working with randomized
# demographics on patients, so that the Expected Results Validator can
# treat augmented calculation results as it would their originals.
class CalculatingAugmentedResults
def self.augment... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/validators/qrda_cat3_validator.rb | Ruby | apache-2.0 | 89 | master | 1,943 | # frozen_string_literal: true
require 'validators/qrda_cat1_validator'
module Validators
class QrdaCat3Validator < QrdaFileValidator
include ::CqmValidators
def initialize(expected_results, is_c3_validation_task, test_has_c3, test_has_c2, bundle)
@bundle = bundle
@is_c3_validation_task = is_c3_v... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/validators/encounter_validator.rb | Ruby | apache-2.0 | 89 | master | 2,636 | # frozen_string_literal: true
module Validators
class EncounterValidator < QrdaFileValidator
include Validators::Validator
def validate(file, options = {})
doc = get_document(file)
encounter_times = doc.xpath("//cda:encounter[cda:templateId/@root = '2.16.840.1.113883.10.20.24.3.23']/cda:effectiv... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/validators/calculating_augmented_records.rb | Ruby | apache-2.0 | 89 | master | 2,322 | # frozen_string_literal: true
module Validators
# This is a set of helper methods to assist in working with randomized
# demographics on patients, so that population results for an augmented
# record can be compared to the results of the original.
class CalculatingAugmentedRecords < CalculatingSmokingGunValida... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/validators/calculating_smoking_gun_validator.rb | Ruby | apache-2.0 | 89 | master | 5,498 | # frozen_string_literal: true
module Validators
class CalculatingSmokingGunValidator < SmokingGunValidator
include Validators::Validator
def initialize(measures, records, test_id, options = {})
@measures = measures
super
end
# rubocop:disable Metrics/AbcSize
def parse_record(doc, opt... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/validators/expected_supplemental_results.rb | Ruby | apache-2.0 | 89 | master | 4,083 | # frozen_string_literal: true
module Validators
# This is a set of helper methods to validate reported supplemental values associated
# with a population key against reported ones.
class ExpectedSupplementalResults < QrdaFileValidator
include Validators::Validator
def initialize(file_name)
@file_n... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/validators/cms_schematron_validator.rb | Ruby | apache-2.0 | 89 | master | 2,554 | # frozen_string_literal: true
module Validators
class CMSSchematronValidator < QrdaFileValidator
include Validators::Validator
include ::CqmValidators
def initialize(schematron_file, name, as_warnings, bundle_version = Settings.current.default_bundle)
@validator = Schematron::Validator.new(name, sc... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/validators/measure_period_validator.rb | Ruby | apache-2.0 | 89 | master | 6,471 | # frozen_string_literal: true
module Validators
class MeasurePeriodValidator < QrdaFileValidator
include Validators::Validator
include QrdaHelper
# All Encounter end times
DISCHARGE_SELECTOR = "//cda:encounter[./cda:templateId[@root='2.16.840.1.113883.10.20.24.3.23']]/cda:effectiveTime/cda:high/@val... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/validators/program_validator.rb | Ruby | apache-2.0 | 89 | master | 894 | # frozen_string_literal: true
module Validators
class ProgramValidator < QrdaFileValidator
include Validators::Validator
def initialize(programs)
@programs = programs.map(&:upcase)
end
def validate(file, options = {})
@document = get_document(file)
# xpath for informationRecipient... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/validators/expected_results_validator.rb | Ruby | apache-2.0 | 89 | master | 7,073 | # frozen_string_literal: true
module Validators
class ExpectedResultsValidator < QrdaFileValidator
include ::CqmValidators::ReportedResultExtractor
include Validators::Validator
attr_accessor :reported_results
def initialize(expected_results, randomization)
@expected_results = expected_results... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/validators/core_clinical_data_element_validator.rb | Ruby | apache-2.0 | 89 | master | 3,694 | # frozen_string_literal: true
module Validators
class CoreClinicalDataElementValidator < QrdaFileValidator
include Validators::Validator
include QrdaHelper
def initialize(measures)
@test_measure_ids = measures.pluck(:hqmf_id)
end
def validate(file, options = {})
ccde_measure_ids = A... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/validators/validator.rb | Ruby | apache-2.0 | 89 | master | 1,329 | # frozen_string_literal: true
module Validators
module Validator
def errors
@errors ||= []
end
def add_error(msg, options = {})
add_issue(msg, :error, options)
end
def add_warning(msg, options = {})
add_issue(msg, :warning, options)
end
def add_issue(msg, msg_type, op... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/validators/cat3_population_validator.rb | Ruby | apache-2.0 | 89 | master | 7,716 | # frozen_string_literal: true
module Validators
class Cat3PopulationValidator < QrdaFileValidator
include Validators::Validator
include ::CqmValidators::ReportedResultExtractor
include QrdaHelper
def initialize(expected_measures = [])
@expected_measures = expected_measures
end
def val... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/tasks/cucumber.rake | Ruby | apache-2.0 | 89 | master | 2,715 | # IMPORTANT: This file is generated by cucumber-rails - edit at your own peril.
# It is recommended to regenerate this file in the future when you upgrade to a
# newer version of cucumber-rails. Consider adding your own code to a new file
# instead of editing this one. Cucumber will automatically load all features/**/*... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/tasks/evaluator.rake | Ruby | apache-2.0 | 89 | master | 2,239 | # frozen_string_literal: true
namespace :evaluator do
task setup: :environment
desc %(
Clean up generated vendor/product/tests/executions in Cypress
)
task cleanup: :setup do
mev = Cypress::MeasureEvaluator.new
mev.cleanup
end
desc %(
Generate and execute C2/C3 product tests for all measu... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/tasks/bundle.rake | Ruby | apache-2.0 | 89 | master | 1,975 | # frozen_string_literal: true
namespace :bundle do
task setup: :environment
desc %(
Upload precalculate bundle file with extension .zip
)
task :precalculate_bundle, [:file] => :setup do |_, args|
bundle = Cypress::CqlBundleImporter.import(File.new(args.file), Tracker.new, include_highlighting: true)
... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/tasks/bundle_eval.rake | Ruby | apache-2.0 | 89 | master | 11,974 | # frozen_string_literal: true
namespace :bundle do
namespace :eval do
task setup: :environment
desc %(Evaluate a bundle for potential 'single measure' calculation issues due to code crosswalk.
You must identify the bundle version:
$ rake bundle:eval:code_crosswalk[xxxx.x.x])
task :code_crosswa... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/tasks/tmp.rake | Ruby | apache-2.0 | 89 | master | 761 | # frozen_string_literal: true
require 'rails/tasks'
namespace :tmp do
namespace :cache do
# desc "Cleans and then rebuilds the cypress cache"
task rebuild: [:environment] do
puts 'Warming the vendor and product state cache...'
Vendor.each(&:status)
end
desc 'Rebuilds the MPL Download .z... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/tasks/cypress.rake | Ruby | apache-2.0 | 89 | master | 5,509 | # frozen_string_literal: true
namespace :cypress do
namespace :cleanup do
task setup: :environment
desc 'Remove temporary items (such as vendors, tests, etc) from the database, without removing existing users'
task database: :setup do
print 'Cleaning database...'
Delayed::Job.destroy_all
... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/tasks/admin.rake | Ruby | apache-2.0 | 89 | master | 1,914 | # frozen_string_literal: true
namespace :cypress do
task setup: :environment
desc %(
Add an admin user
)
task :create_admin, %i[email password] => :setup do |_, args|
user = User.where(email: args.email).first
if user
puts %( A user with the email address #{args.email} already existis in the... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/ext/bundle.rb | Ruby | apache-2.0 | 89 | master | 5,389 | # frozen_string_literal: true
class Bundle
include Mongoid::Document
include Mongoid::Timestamps
include Mongoid::Attributes::Dynamic
store_in collection: 'bundles'
field :title, type: String
field :name, type: String
field :version, type: String
field :license, type: String
field :extensions, type:... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/ext/zip_file_generator.rb | Ruby | apache-2.0 | 89 | master | 1,274 | # frozen_string_literal: true
class ZipFileGenerator
# Initialize with the directory to zip and the location of the output archive.
def initialize(input_dir, output_file)
@input_dir = input_dir
@output_file = output_file
end
# Zip the input directory.
def write
entries = Dir.entries(@input_dir) ... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/ext/value_set.rb | Ruby | apache-2.0 | 89 | master | 417 | # frozen_string_literal: true
ValueSet = CQM::ValueSet
Concept = CQM::Concept
class ValueSet
include Mongoid::Document
store_in collection: 'health_data_standards_svs_value_sets'
belongs_to :bundle, class_name: 'Bundle', inverse_of: :value_sets
def snomed_codes?
concepts.any? { |concept| concept.code_sy... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/ext/qdm/data_element.rb | Ruby | apache-2.0 | 89 | master | 1,431 | # frozen_string_literal: true
module QDM
# Represents QDM datatype (parent class of all generated QDM datatype models)
class DataElement
field :dataElementAttributes, type: Array, default: []
field :encounter_id, type: BSON::ObjectId
field :denormalize_as_datetime, type: Boolean
def occurs_after_d... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/ext/qdm/id.rb | Ruby | apache-2.0 | 89 | master | 296 | # frozen_string_literal: true
# The Id model is an extension of app/models/qdm/id.rb as defined by CQM-Models.
module QDM
class Id
# TODO: remove Dynamic attributes. This is only here for supporting 2018.0.1 bundle import functionality.
include Mongoid::Attributes::Dynamic
end
end |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/ext/cqm/provider.rb | Ruby | apache-2.0 | 89 | master | 2,557 | # frozen_string_literal: true
Faker::Config.locale = 'en-US'
Provider = CQM::Provider
module CQM
class Provider
has_many :measure_tests
def self.default_provider(options = {})
prov = where(default: true, specialty: default_specialty(options[:measure_type])).first
if prov.nil?
prov = CQ... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/ext/cqm/individual_result.rb | Ruby | apache-2.0 | 89 | master | 13,401 | # frozen_string_literal: true
IndividualResult = CQM::IndividualResult
module CQM
class IndividualResult
store_in collection: 'individual_results'
field :population_set_key, type: String
field :correlation_id, type: String
field :file_name, type: String
def relevant?
true if (!self['IPP'... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/ext/cqm/patient.rb | Ruby | apache-2.0 | 89 | master | 16,291 | # frozen_string_literal: true
# The Patient model is an extension of app/models/qdm/patient.rb as defined by CQM-Models.
module CQM
class Patient
include Mongoid::Timestamps
field :correlation_id, type: BSON::ObjectId
field :original_patient_id, type: BSON::ObjectId
field :original_medical_record_nu... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/ext/cqm/measure.rb | Ruby | apache-2.0 | 89 | master | 4,106 | # frozen_string_literal: true
Measure = CQM::Measure
module CQM
class Measure
store_in collection: 'measures'
validates_inclusion_of :reporting_program_type, in: %w[ep eh]
field :reporting_program_type, type: String
field :category, type: String
field :annual_update, type: String
field :b... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/cypress/measure_evaluator.rb | Ruby | apache-2.0 | 89 | master | 4,164 | # frozen_string_literal: true
# :nocov:
module Cypress
class MeasureEvaluator
def initialize(args = nil)
@options = args || {}
@logger = Rails.logger
end
def evaluate_all_cat3(args = nil)
opts = args || @options
generate_tests(opts)
wait_for_calculations
# upload_al... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/cypress/data_criteria_selector.rb | Ruby | apache-2.0 | 89 | master | 3,067 | # frozen_string_literal: true
module Cypress
module DataCriteriaSelector
def data_criteria_selector(measure, prng)
# Criterias to be used in C1 checklist
criterias = []
# Possible data criterias that don't have attributes
data_criteria_without_att = {}
# Criteria types in C1 checkli... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/cypress/patient_filter.rb | Ruby | apache-2.0 | 89 | master | 2,030 | # frozen_string_literal: true
module Cypress
class PatientFilter
def self.filter(records, filters, options)
filtered_patients = []
records.each do |patient|
filtered_patients << patient unless patient_missing_filter(patient, filters, options)
end
filtered_patients
end
def... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/cypress/criteria_picker.rb | Ruby | apache-2.0 | 89 | master | 3,074 | # frozen_string_literal: true
module Cypress
class CriteriaPicker
# TODO: R2P: pick filter criteria using new model
def self.races(patient, _options = {})
race_element = patient.qdmPatient.get_data_elements('patient_characteristic', 'race').first
[race_element.dataElementCodes.first.code]
end... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/cypress/name_randomizer.rb | Ruby | apache-2.0 | 89 | master | 3,767 | # frozen_string_literal: false
module Cypress
class NameRandomizer
def self.randomize_patient_name_first(patient, augmented_patients, random: Random.new)
patients = patient.product_test ? patient.product_test.patients : []
original_given_name = patient.givenNames
loop do
# Each time, st... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/cypress/data_criteria_attribute_builder.rb | Ruby | apache-2.0 | 89 | master | 18,127 | # frozen_string_literal: true
module Cypress
class DataCriteriaAttributeBuilder
def build_data_criteria_for_measure(measure)
@measure = measure
@vs_hash = {}
@cql_data_criteria = []
@unionlist = []
@root_data_criteria = {}
@expression_hash = {}
@alias_hash = {}
@un... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/cypress/product_status_values.rb | Ruby | apache-2.0 | 89 | master | 4,690 | # frozen_string_literal: true
module Cypress
module ProductStatusValues
STATUS_NAMES = %w[passing failing errored not_started total].freeze
def cms_status_values(product)
h = {}
h['CMS Program Tests'] = STATUS_NAMES.zip(product_test_statuses(product.product_tests.cms_program_tests, 'CMSProgramTa... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/cypress/provider_filter.rb | Ruby | apache-2.0 | 89 | master | 1,287 | # frozen_string_literal: true
module Cypress
class ProviderFilter
def self.filter(providers, filters, options)
# TODO: R2P: filter using new model, replace with patients
providers.where create_query(filters, options)
end
def self.create_query(input_filters, _options)
query_pieces = []
... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/cypress/cqm_execution_calc.rb | Ruby | apache-2.0 | 89 | master | 3,871 | # frozen_string_literal: true
require 'json'
require 'securerandom'
module Cypress
class CQMExecutionCalc
attr_accessor :patients, :measures, :options
def initialize(patients, measures, correlation_id, options)
@patients = patients
@connection_string = self.class.create_56_connection_string
... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/cypress/expected_results_calculator.rb | Ruby | apache-2.0 | 89 | master | 9,386 | # frozen_string_literal: true
module Cypress
class ExpectedResultsCalculator
# The ExpectedResultsCalculator aggregates Individual Results to calculated the expected results for a
# Measure Test or Task
# @param [Array] patients the list of patients that are included in the aggregate results
# @para... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/cypress/mbi_generator.rb | Ruby | apache-2.0 | 89 | master | 752 | # frozen_string_literal: true
module Cypress
class MbiGenerator
# 2, 5, 8, and 9 characters are always letters
# 1, 4, 7, 10, and 11 characters are always numbers
# The 3rd and 6th characters are letters or numbers.
# CMS doesnt use dashes in the MBI.
# Position 1 is numeric values 1 thru 9
d... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/cypress/qrda_post_processor.rb | Ruby | apache-2.0 | 89 | master | 9,827 | # frozen_string_literal: true
module Cypress
module QrdaPostProcessor
def self.add_display_name(codes, patient, bundle)
patient.qdmPatient.dataElements.each do |de|
next unless de['negationRationale']
build_code_descriptions(codes, patient, bundle) if patient.code_description_hash.empty?
... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/cypress/clinical_randomizer.rb | Ruby | apache-2.0 | 89 | master | 7,146 | # frozen_string_literal: true
module Cypress
class ClinicalRandomizer
def self.randomize(patient, effective_date, measure_period_start, random: Random.new)
case random.rand(2)
when 0
split_by_date(patient, effective_date, measure_period_start, random)
when 1
split_by_type(patien... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/cypress/demographics_randomizer.rb | Ruby | apache-2.0 | 89 | master | 10,345 | # frozen_string_literal: true
Faker::Config.locale = 'en-US'
module Cypress
# This is a set of helper methods to randomize demographic components of records. Currently it
# can randomize name, race, ethnicity, address, and insurance provider. To randomize all
# demographics, call Cypress::DemographicsRandomize... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/cypress/patient_zipper.rb | Ruby | apache-2.0 | 89 | master | 4,234 | # frozen_string_literal: true
require 'builder'
require 'csv'
require 'open-uri'
require 'zip/zip'
require 'zip/zipfilesystem'
module Cypress
class HTMLExporter
# TODO: add HTML Export in CQM-Parsers
# EXPORTER = HealthDataStandards::Export::HTML.new
attr_accessor :measures
def initialize(measures... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/cypress/scoop_and_filter.rb | Ruby | apache-2.0 | 89 | master | 7,399 | # frozen_string_literal: true
module Cypress
class ScoopAndFilter
def initialize(measures)
@valuesets = measures.collect(&:value_sets).flatten.uniq
@relevant_codes = codes_in_measures
@de_category_statuses_for_measures = get_non_demographic_category_statuses(measures)
end
# return an a... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/cypress/population_clone_job.rb | Ruby | apache-2.0 | 89 | master | 9,896 | # frozen_string_literal: true
module Cypress
# This is Resque job that will create patients for a ProductTest. Currently you have the choice between doing a full
# clone of the test deck or a specific subset to cover the 3 core measures. In the near future we will support more
# options to make very customized T... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/cypress/api_measure_evaluator.rb | Ruby | apache-2.0 | 89 | master | 33,271 | # frozen_string_literal: true
# :nocov:
require 'time'
module Cypress
class ApiMeasureEvaluator
def initialize(username, password, args = nil)
@allowable_population_ids = []
@options = args || {}
@logger = Rails.logger
@patient_link_product_test_hash = {}
@patient_links_task_hash = ... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/cypress/create_download_zip.rb | Ruby | apache-2.0 | 89 | master | 5,422 | # frozen_string_literal: true
module Cypress
class CreateDownloadZip
include ChecklistTestsHelper
def self.create_test_zip(test_id, format = 'html')
pt = ProductTest.find(test_id)
create_zip(pt.patients.to_a, format)
end
def self.create_zip(patients, format)
file = Tempfile.new("pa... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/cypress/create_total_test_zip.rb | Ruby | apache-2.0 | 89 | master | 2,537 | # frozen_string_literal: true
module Cypress
class CreateTotalTestZip
def self.create_total_test_zip(product, criteria_list, filtering_list, format = 'qrda')
file = Tempfile.new("all-patients-#{Time.now.to_i}")
Zip::ZipOutputStream.open(file.path) do |z|
add_multi_measure_zips(z, product.prod... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/cypress/example_patient_finder.rb | Ruby | apache-2.0 | 89 | master | 1,160 | # frozen_string_literal: true
module Cypress
class ExamplePatientFinder
# TODO: R2P: get sample patients (for checklist test) with new model
def self.find_example_patient(measure)
simplest = 100
example_patient = nil
# patient_ids for patients with IndividualResult for the measure specifie... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/cypress/cql_bundle_importer.rb | Ruby | apache-2.0 | 89 | master | 13,335 | # frozen_string_literal: true
require 'cqm-parsers'
module Cypress
class CqlBundleImporter
SOURCE_ROOTS = { bundle: 'bundle.json',
measures: 'measures', measures_info: 'measures-info.json',
calculations: 'calculations',
valuesets: File.join('value-s... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/cypress/error_collector.rb | Ruby | apache-2.0 | 89 | master | 3,946 | # frozen_string_literal: true
module Cypress
module ErrorCollector
class FileNotFound < StandardError
end
# include_locations (default true) to include the xml locations mapping with collected errors
def self.collected_errors(execution, include_locations: true)
# gonna return all the errors fo... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/cypress/npi_generator.rb | Ruby | apache-2.0 | 89 | master | 591 | # frozen_string_literal: true
module Cypress
class NpiGenerator
def self.generate
random_number = rand.to_s[2..9]
random_number = "1#{random_number}"
check_digit = checksum("80840#{random_number}")
random_number + check_digit.to_s
end
def self.checksum(number)
digits = numb... |
github | projectcypress/cypress | https://github.com/projectcypress/cypress | lib/highlighting/highlighting.rb | Ruby | apache-2.0 | 89 | master | 6,852 | # frozen_string_literal: true
class Highlighting < Mustache
# This is a set of helper methods to allow for measure highlighting. Currently it
# can display the results of the data and hightlight the portions as true, or false
# based on individual result.
class ClauseObject
# A ClauseObject will hold a sp... |
github | heroku/netrc | https://github.com/heroku/netrc | Rakefile | Ruby | mit | 89 | master | 229 | # frozen_string_literal: true
require "bundler/gem_tasks"
require "rake/testtask"
Rake::TestTask.new(:test) do |t|
t.libs << "test"
t.libs << "lib"
t.test_files = FileList["test/**/*_test.rb"]
end
task :default => :test |
github | heroku/netrc | https://github.com/heroku/netrc | netrc.gemspec | Ruby | mit | 89 | master | 774 | $:.unshift File.expand_path("../lib", __FILE__)
require "netrc"
Gem::Specification.new do |gem|
gem.name = "netrc"
gem.version = Netrc::VERSION
gem.authors = ["Keith Rarick", "geemus (Wesley Beary)"]
gem.description = "This library can read and update netrc files, preserving formatting including commen... |
github | heroku/netrc | https://github.com/heroku/netrc | test/netrc_test.rb | Ruby | mit | 89 | master | 12,732 | require 'test_helper'
class TestNetrc < Minitest::Test
def setup
Dir.glob('data/*.netrc').each{|f| File.chmod(0600, f)}
File.chmod(0644, "data/permissive.netrc")
File.chmod(0000, "data/restrictive0000.netrc")
File.chmod(0400, "data/restrictive0400.netrc")
File.chmod(0600, "data/restrictive0600.... |
github | heroku/netrc | https://github.com/heroku/netrc | test/parse_test.rb | Ruby | mit | 89 | master | 864 | require 'test_helper'
class TestParse < Minitest::Test
def test_parse_empty
pre, items = Netrc.parse([])
assert_equal("", pre)
assert_equal([], items)
end
def test_parse_comment
pre, items = Netrc.parse(["# foo\n"])
assert_equal("# foo\n", pre)
assert_equal([], items)
end
def test_p... |
github | heroku/netrc | https://github.com/heroku/netrc | test/lex_test.rb | Ruby | mit | 89 | master | 1,332 | require 'test_helper'
class TestLex < Minitest::Test
def test_lex_empty
t = Netrc.lex([])
assert_equal([], t)
end
def test_lex_comment
t = Netrc.lex(["# foo\n"])
assert_equal(["# foo\n"], t)
end
def test_lex_comment_after_space
t = Netrc.lex([" # foo\n"])
assert_equal([" # foo\n"], ... |
github | heroku/netrc | https://github.com/heroku/netrc | lib/netrc.rb | Ruby | mit | 89 | master | 7,895 | require 'rbconfig'
require 'io/console'
class Netrc
VERSION = "0.11.0"
# see http://stackoverflow.com/questions/4871309/what-is-the-correct-way-to-detect-if-ruby-is-running-on-windows
WINDOWS = RbConfig::CONFIG["host_os"] =~ /mswin|mingw|cygwin/
CYGWIN = RbConfig::CONFIG["host_os"] =~ /cygwin/
def self.de... |
github | rubaidh/rubaidhstrano | https://github.com/rubaidh/rubaidhstrano | recipes/daemon_strategy.rb | Ruby | mit | 89 | master | 327 | # Hook into +load+ so that all configuration is loaded before we do anything.
# That way, we know what deployment strategy the main deployment recipe has
# chosen.
on :load do
case fetch(:daemon_strategy, :spinner)
when :passenger
load "#{File.join(File.dirname(__FILE__), 'daemon_strategies', 'passenger')}"
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.