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
test/models/c1_checklist_task_test.rb
Ruby
apache-2.0
89
master
3,701
# frozen_string_literal: true require 'test_helper' class C1ChecklistTaskTest < ActiveSupport::TestCase include ::Validators include ActiveJob::TestHelper def setup @user = User.create(email: 'vendor@test.com', password: 'TestTest!', password_confirmation: 'TestTest!', terms_and_conditions: '1') produc...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
test/models/multi_measure_cat1_task_test.rb
Ruby
apache-2.0
89
master
1,821
# frozen_string_literal: true require 'test_helper' class MultiMeasureCat1TaskTest < ActiveSupport::TestCase include ::Validators include ActiveJob::TestHelper def setup @user = User.create(email: 'vendor@test.com', password: 'TestTest!', password_confirmation: 'TestTest!', terms_and_conditions: '1') @v...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
test/models/test_execution_test.rb
Ruby
apache-2.0
89
master
5,555
# frozen_string_literal: true require 'test_helper' class TestExecutionTest < ActiveSupport::TestCase def setup @bundle = FactoryBot.create(:static_bundle) vendor = Vendor.create(name: 'test_vendor_name') product = vendor.products.create(name: 'test_product', c1_test: true, bundle_id: @bundle.id, measure...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
test/models/vendor_test.rb
Ruby
apache-2.0
89
master
7,117
# frozen_string_literal: true require 'test_helper' class VendorTest < ActiveSupport::TestCase VENDOR = '4def93dd4f85cf8968000003' OTHER_VENDOR = '4def93dd4f85cf8968000004' def setup FactoryBot.create(:admin_user) FactoryBot.create(:atl_user) FactoryBot.create(:user_user) FactoryBot.create(:vend...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
test/models/checklist_source_data_criteria_test.rb
Ruby
apache-2.0
89
master
3,812
# frozen_string_literal: true require 'test_helper' class ChecklistSourceDataCriteriaTest < ActiveJob::TestCase def setup @vendor = FactoryBot.create(:vendor) @bundle = FactoryBot.create(:static_bundle) measure_ids = ['BE65090C-EB1F-11E7-8C3F-9A214CF093AE'] @product = @vendor.products.build(name: "m...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
test/models/multi_measure_cat3_task_test.rb
Ruby
apache-2.0
89
master
1,534
# frozen_string_literal: true require 'test_helper' class MultiMeasureCat3TaskTest < ActiveSupport::TestCase include ::Validators include ActiveJob::TestHelper def setup @user = User.create(email: 'vendor@test.com', password: 'TestTest!', password_confirmation: 'TestTest!', terms_and_conditions: '1') @...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
test/models/patient_test.rb
Ruby
apache-2.0
89
master
15,493
# frozen_string_literal: false require 'test_helper' class PatientTest < ActiveSupport::TestCase def setup @bundle = FactoryBot.create(:static_bundle) end def test_nullify_unnessissary_negations sample_patient = @bundle.patients.first sample_measure = @bundle.measures.first valueset_oids = samp...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
test/helpers/patient_analysis_helper_test.rb
Ruby
apache-2.0
89
master
1,880
# frozen_string_literal: true require 'test_helper' class PatientAnalysisHelperTest < ActiveSupport::TestCase include PatientAnalysisHelper def setup @bundle = FactoryBot.create(:static_bundle) @vendor = FactoryBot.create(:vendor_with_points_of_contact) FactoryBot.create(:vendor_test_patient, bundleI...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
test/helpers/checklist_tests_helper_test.rb
Ruby
apache-2.0
89
master
2,723
# frozen_string_literal: true require 'test_helper' class ChecklistTestsHelperTest < ActiveSupport::TestCase include ChecklistTestsHelper # This ensures that the filtering on lookup_codevalues properly limits results # to a specific bundle when specified def test_lookup_codevalues_multiple_bundles @bundl...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
test/helpers/caching_test.rb
Ruby
apache-2.0
89
master
1,420
# frozen_string_literal: true require 'test_helper' class CachingTest < ActiveSupport::TestCase def setup @bundle = FactoryBot.create(:static_bundle) @user = User.create(email: 'vendor@test.com', password: 'TestTest!', password_confirmation: 'TestTest!', terms_and_conditions: '1') ActionController::Base...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
test/helpers/filtering_tests_helper_test.rb
Ruby
apache-2.0
89
master
2,213
# frozen_string_literal: true require 'test_helper' class FilteringTestsHelperTest < ActiveSupport::TestCase include FilteringTestsHelper def setup @bundle = FactoryBot.create(:static_bundle) @filters = { providers: { npis: ['6892960108'], tins: ['1554520'], addresses: [{ ...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
test/helpers/products_helper_test.rb
Ruby
apache-2.0
89
master
19,591
# frozen_string_literal: true require 'test_helper' class ProductsHelperTest < ActiveJob::TestCase include ProductsHelper # include ActiveJob::TestHelper def setup drop_database @bundle = FactoryBot.create(:static_bundle) @user = FactoryBot.create(:vendor_user) @user.save! @vendor = Factory...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
test/helpers/measure_helper_test.rb
Ruby
apache-2.0
89
master
3,163
# frozen_string_literal: true require 'test_helper' class MeasureHelperTest < ActiveSupport::TestCase def setup APP_CONSTANTS['CPC_measures'] = { '2018' => %w[53e3f13d-e5cf-445f-8dda-3720aff84011 53e3f13d-e5cf-445f-8dda-3720aff84012] } @bundle = FactoryBot.create(:static_bundle) @cpc_and_diag_msrs = ['5...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
test/helpers/xml_view_helper_test.rb
Ruby
apache-2.0
89
master
1,849
# frozen_string_literal: true require 'test_helper' class XmlViewHelperTest < ActiveSupport::TestCase include XmlViewHelper include ActiveJob::TestHelper def setup user = FactoryBot.create(:vendor_user) product_test = FactoryBot.create(:cv_product_test_static_result) product_test.product.c1_test = ...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
test/helpers/test_executions_helper_test.rb
Ruby
apache-2.0
89
master
9,761
# frozen_string_literal: true require 'test_helper' class TestExecutionHelper < ActiveSupport::TestCase include TestExecutionsHelper include ApplicationHelper include ActiveJob::TestHelper # # # # # # # # # # S E T U P # # # # # # # # # # def setup @bundle = FactoryBot.create(:static_bundle) ...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
test/helpers/vendors_helper_test.rb
Ruby
apache-2.0
89
master
21,704
# frozen_string_literal: true require 'test_helper' class VendorsHelperTest < ActiveJob::TestCase include VendorsHelper include ProductsHelper def setup drop_database product_test = FactoryBot.create(:product_test_static_result) @user = FactoryBot.create(:vendor_user) @bundle = product_test.bun...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
test/integration/api_measure_evaluator_test.rb
Ruby
apache-2.0
89
master
11,931
# frozen_string_literal: true require 'test_helper' require 'vcr_setup' class ApiMeasureEvaluatorTest < ActionController::TestCase include Devise::Test::ControllerHelpers include ActiveJob::TestHelper def setup @apime = Cypress::ApiMeasureEvaluator.new('test', 'test') import_bundle_and_create_product(r...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
test/factories/measures.rb
Ruby
apache-2.0
89
master
7,150
# frozen_string_literal: true FactoryBot.define do factory :measure, class: Measure do entry = Rails.root.join('test', 'fixtures', 'artifacts', 'cms32v7.json') transient do seq_id { 1 } end source_measure = JSON.parse(File.read(entry), max_nesting: 100) description { "Measure Description #{...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
test/factories/execution_error.rb
Ruby
apache-2.0
89
master
14,650
# frozen_string_literal: true FactoryBot.define do factory :execution_error, class: ExecutionError do test_execution after(:build) do |ee| ee[:validator_type] = ee.validation_type&.to_sym end factory :calculating_smoking_gun_validator do msg_type { 'error' } validation_type { 'res...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
test/factories/pocs.rb
Ruby
apache-2.0
89
master
397
# frozen_string_literal: true FactoryBot.define do factory :poc, class: PointOfContact do sequence(:name) { |i| "Contact #{i}" } sequence(:email) { |i| "contact#{i}@example.com" } phone { '1(222)333-4444' } contact_type { 'Admin' } sequence(:id) { |i| i } factory :poc1 do name { 'poc1'...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
test/factories/filter_tests.rb
Ruby
apache-2.0
89
master
2,901
# frozen_string_literal: true FactoryBot.define do factory :filter_test, class: FilteringTest do sequence(:name) { |i| "Product Test Name #{i}" } factory :static_filter_test do name { 'Static Result' } _type { 'FilteringTest' } options { { 'filters' => { 'genders' => ['F'] } } } expe...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
test/factories/bundles.rb
Ruby
apache-2.0
89
master
4,444
# frozen_string_literal: true FactoryBot.define do factory :bundle, class: Bundle do sequence(:name) { |i| "Bundle Name #{i}" } sequence(:version) { |i| "#{2050 + i}.0.0" } sequence(:title) { |i| "Bundle Name #{i}" } # static_bundle includes random measures that will not execute in the cqm-execution...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
test/factories/patients.rb
Ruby
apache-2.0
89
master
5,171
# frozen_string_literal: true # Requires a bundleId to be passed in as a string, not a BSON Object FactoryBot.define do factory :patient, class: BundlePatient do transient do seq_id { 1 } end medical_record_number { "#{seq_id}989db70-4d42-0135-8680-20999b0ed66f" } factory :static_bundle_pati...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
test/factories/product_tests.rb
Ruby
apache-2.0
89
master
7,864
# frozen_string_literal: true FactoryBot.define do factory :product_test, class: MeasureTest do sequence(:name) { |i| "Product Test Name #{i}" } factory :product_test_static_result do name { 'Static Result' } _type { 'MeasureTest' } cms_id { 'CMS1234' } aug_record = [{ 'original_pati...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
test/factories/users.rb
Ruby
apache-2.0
89
master
1,531
# frozen_string_literal: true FactoryBot.define do factory :user, class: User do email { 'test@test.com' } password { 'Cypre$$v3' } terms_and_conditions { '1' } factory :admin_user do id { '4def93dd4f85cf8968000010' } email { 'admin@test.com' } password { 'Cypre$$v3' } terms_...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
test/factories/individual_result.rb
Ruby
apache-2.0
89
master
380
# frozen_string_literal: true FactoryBot.define do factory :cqm_individual_result, class: CQM::IndividualResult do measure_id { Measure.find_by(hqmf_id: '40280382-5FA6-FE85-0160-0918E74D2075')._id } end factory :cv_cqm_individual_result, class: CQM::IndividualResult do measure_id { Measure.find_by(hqmf_...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
test/factories/qdm_patient.rb
Ruby
apache-2.0
89
master
6,491
# frozen_string_literal: true FactoryBot.define do factory :qdm_patient, class: QDM::Patient do qdmVersion { '5.4' } birthDatetime { DateTime.new(1950, 1, 1).utc } data_elements_value = [ { 'authorDatetime' => '2017-09-28T08:00:00.000+00:00', 'qdmCategory' => 'procedure', 'c...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
test/factories/products.rb
Ruby
apache-2.0
89
master
993
# frozen_string_literal: true FactoryBot.define do factory :product, class: Product do sequence(:name) { |i| "Product Name #{i}" } factory :product_no_name do name { '' } end factory :product_static_name do name { 'Product Same Name' } end factory :static_product do name ...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
test/factories/vendors.rb
Ruby
apache-2.0
89
master
1,069
# frozen_string_literal: true FactoryBot.define do factory :vendor, class: Vendor do sequence(:name) { |i| "Vendor Name #{i}" } preferred_code_systems { { 'encounter' => ['2.16.840.1.113883.6.96'] } } factory :vendor_with_poc do points_of_contact { [FactoryBot.build(:poc)] } end factory ...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
test/factories/multi_measure_tests.rb
Ruby
apache-2.0
89
master
3,397
# frozen_string_literal: true FactoryBot.define do factory :multi_measure_test, class: MultiMeasureTest do sequence(:name) { |i| "Product Test Name #{i}" } factory :multi_measure_test_static_result do name { 'Static Result' } _type { 'MultiMeasureTest' } cms_id { 'CMS1234' } aug_reco...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
test/factories/providers.rb
Ruby
apache-2.0
89
master
2,048
# frozen_string_literal: true FactoryBot.define do factory :provider, class: Provider do sequence(:givenNames) { |i| ["Given_Name #{i}"] } sequence(:familyName) { |i| ["Family_Name #{i}"] } specialty { '200000000X' } trait :default do addresses { [{ 'street' => ['202 Burlington Rd'], 'city' => ...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
test/factories/value_sets.rb
Ruby
apache-2.0
89
master
3,383
# frozen_string_literal: true FactoryBot.define do factory :value_set, class: ValueSet do transient do seq_id { 1 } end display_name { "Value Set Name #{seq_id}" } oid { "1.#{seq_id}.#{seq_id + 1}.#{seq_id + 2}" } version { '123' } concepts { [{ 'code' => (seq_id * (seq_id + 1) * (seq_...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/representers/measure_representer.rb
Ruby
apache-2.0
89
master
208
# frozen_string_literal: true module MeasureRepresenter include Api::Representer property :hqmf_id property :cms_id property :description property :reporting_program_type property :category end
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/representers/product_representer.rb
Ruby
apache-2.0
89
master
716
# frozen_string_literal: true module ProductRepresenter include Api::Representer property :name property :version property :description property :c1_test property :c2_test property :c3_test property :c4_test property :cures_update property :randomize_patients property :duplicate_patients colle...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/representers/test_execution_representer.rb
Ruby
apache-2.0
89
master
497
# frozen_string_literal: true module TestExecutionRepresenter include Api::Representer property :state property :execution_errors property :created_at self.links = { self: proc { task_test_execution_path(task, self) }, sibling_execution: proc { sibling_execution ? task_test_execution_path(sibling_e...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/representers/bundle_representer.rb
Ruby
apache-2.0
89
master
236
# frozen_string_literal: true module BundleRepresenter include Api::Representer property :title property :version self.links = { self: proc { bundle_path(self) }, measures: proc { bundle_measures_path(self) } } end
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/representers/task_representer.rb
Ruby
apache-2.0
89
master
410
# frozen_string_literal: true module TaskRepresenter include Api::Representer property :type, getter: ->(_args) { _type.delete('Task') } self.links = { self: proc { product_test_task_path(product_test, self) }, executions: proc { task_test_executions_path(self) }, most_recent_execution: proc { most...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/representers/product_test_representer.rb
Ruby
apache-2.0
89
master
3,223
# frozen_string_literal: true require 'representable/xml' module ProductTestRepresenter include Api::Representer property :name property :cms_id property :measure_id, getter: ->(_args) { measure_ids.first } property :type, getter: ->(_args) { _type == 'MeasureTest' ? 'measure' : 'filter' } property :state...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/representers/vendor_representer.rb
Ruby
apache-2.0
89
master
435
# frozen_string_literal: true module VendorRepresenter include Api::Representer property :vendor_id property :name property :url property :address property :zip property :state property :created_at property :updated_at self.embedded = { points_of_contact: %i[name email phone contact_type] }...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/representers/qrda_upload_representer.rb
Ruby
apache-2.0
89
master
238
# frozen_string_literal: true module QrdaUploadRepresenter include Api::Representer property :validator property :path property :execution_errors self.embedded = { execution_errors: %i[file_name message validator] } end
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/controllers/tasks_controller.rb
Ruby
apache-2.0
89
master
1,861
# frozen_string_literal: true class TasksController < ApplicationController include Api::Controller before_action :set_task, only: %i[edit update destroy show good_results] before_action :set_product_test, only: %i[index new] before_action :authorize_vendor respond_to :html, only: [] add_breadcrumb 'Das...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/controllers/program_tests_controller.rb
Ruby
apache-2.0
89
master
1,301
# frozen_string_literal: true class ProgramTestsController < ProductTestsController respond_to :js, only: [:show] def show @product = @product_test.product set_breadcrumbs @task = Task.find(params[:task_id]) if params[:task_id] respond_to do |format| format.html format.turbo_stream ...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/controllers/registrations_controller.rb
Ruby
apache-2.0
89
master
939
# frozen_string_literal: true class RegistrationsController < Devise::RegistrationsController add_breadcrumb 'New Account', :new_user_registration_path, only: %i[new create] add_breadcrumb 'Edit User', :edit_user_registration_path, only: %i[edit update] add_breadcrumb 'Cancel Account', :cancel_user_registration_...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/controllers/bundle_downloads_controller.rb
Ruby
apache-2.0
89
master
1,582
# frozen_string_literal: true class BundleDownloadsController < ApplicationController add_breadcrumb 'Download Bundle', :bundle_downloads_path def index @bundle_download = BundleDownload.new @bundle_years = available_bundle_years end def create api_key = params[:bundle_download][:api_key] bun...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/controllers/test_executions_controller.rb
Ruby
apache-2.0
89
master
6,572
# frozen_string_literal: true class TestExecutionsController < ApplicationController include Api::Controller include TestExecutionsHelper include Cypress::ErrorCollector before_action :set_test_execution, only: %i[show destroy file_result] before_action :set_task, only: %i[index new create] before_action ...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/controllers/product_tests_controller.rb
Ruby
apache-2.0
89
master
1,230
# frozen_string_literal: true class ProductTestsController < ApplicationController include Api::Controller before_action :set_product, except: %i[show patients measure html_patients update] before_action :set_product_test, only: %i[show update destroy patients measure html_patients] before_action :authorize_v...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/controllers/admin_controller.rb
Ruby
apache-2.0
89
master
2,015
# frozen_string_literal: true class AdminController < ApplicationController add_breadcrumb 'Admin', :admin_path before_action :require_admin def show @bundles = Bundle.order_by('deprecated asc').all # dont allow them to muck with their own account @users = User.excludes(id: current_user.id).order_by...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/controllers/checklist_tests_controller.rb
Ruby
apache-2.0
89
master
2,946
# frozen_string_literal: true class ChecklistTestsController < ProductTestsController before_action :set_measures, only: [:show] before_action :set_measure, only: [:measure] before_action :check_bundle_deprecated, only: [:show] respond_to :js, only: [:show] def show @product = @product_test.product ...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/controllers/products_controller.rb
Ruby
apache-2.0
89
master
10,626
# frozen_string_literal: true class ProductsController < ApplicationController include Api::Controller before_action :set_vendor, only: %i[index new create report patients favorite] before_action :set_product, except: %i[index new create] before_action :set_measures, only: %i[new edit update report] before_a...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/controllers/vendors_controller.rb
Ruby
apache-2.0
89
master
3,911
# frozen_string_literal: true require 'api' class VendorsController < ApplicationController include Api::Controller before_action :set_vendor, only: %i[show update destroy edit favorite preferences update_preferences] before_action :authorize_vendor, only: %i[show update destroy edit favorite preferences update...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/controllers/qrda_uploads_controller.rb
Ruby
apache-2.0
89
master
1,277
# frozen_string_literal: true class QrdaUploadsController < ApplicationController include Api::Controller include VersionConfigHelper respond_to :xml, :json def index respond_with(possible_qrda_uploaders) end def create path = request.env['PATH_INFO'].split('.')[0] uploader = possible_qrda_u...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/controllers/records_controller.rb
Ruby
apache-2.0
89
master
7,155
# frozen_string_literal: true class RecordsController < ApplicationController include RecordsHelper before_action :set_record_source, only: %i[index show by_measure by_filter_task html_filter_patients] respond_to :js, only: [:index] def index unless Bundle.default @patients = [] @measures = [...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/controllers/sessions_controller.rb
Ruby
apache-2.0
89
master
1,177
# frozen_string_literal: true class SessionsController < Devise::SessionsController def new @title = 'Sign In' super end def create validated_nlm = Settings.current.umls && valid_nlm_user? if validated_nlm || Settings.current.umls == false super elsif Settings.current.umls && validated...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/controllers/version_controller.rb
Ruby
apache-2.0
89
master
337
# frozen_string_literal: true class VersionController < ApplicationController respond_to only: [:index] def index @version = { 'version' => Cypress::Application::VERSION } respond_to do |format| format.xml { render xml: @version.to_xml(root: 'version') } format.json { render json: @version } ...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/controllers/measures_controller.rb
Ruby
apache-2.0
89
master
1,086
# frozen_string_literal: true class MeasuresController < ApplicationController include Api::Controller def index @measures = Bundle.find(params[:bundle_id]).measures respond_with(@measures.to_a) end def grouped @bundle = Bundle.find(params[:bundle_id]) @measures = @bundle.measures.only(:cms_i...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/controllers/application_controller.rb
Ruby
apache-2.0
89
master
5,928
# frozen_string_literal: true class ApplicationController < ActionController::Base include Roar::Rails::ControllerAdditions # Prevent CSRF attacks with a null session protect_from_forgery with: :exception, unless: -> { request.format.json? || request.format.xml? } before_action :restrict_basic_auth, :authent...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/controllers/bundles_controller.rb
Ruby
apache-2.0
89
master
315
# frozen_string_literal: true class BundlesController < ApplicationController include Api::Controller respond_to :xml, :json def index @bundles = Bundle.available.all respond_with(@bundles.to_a) end def show @bundle = Bundle.available.find(params['id']) respond_with(@bundle) end end
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/controllers/admin/settings_controller.rb
Ruby
apache-2.0
89
master
1,172
# frozen_string_literal: true module Admin class SettingsController < AdminController def show redirect_to admin_path(anchor: 'application_settings') end def edit add_breadcrumb 'Edit Settings', :edit_settings_path render locals: Settings.locals_edit(application_mode_settings) end ...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/controllers/admin/bundles_controller.rb
Ruby
apache-2.0
89
master
1,992
# frozen_string_literal: true module Admin class BundlesController < AdminController respond_to :html before_action :find_bundle, only: %i[set_default deprecate destroy] add_breadcrumb 'Add Bundle', :new_admin_bundle_path, only: [:new] def index redirect_to admin_path(anchor: 'bundles') ...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/controllers/admin/trackers_controller.rb
Ruby
apache-2.0
89
master
648
# frozen_string_literal: true module Admin class TrackersController < AdminController before_action :find_tracker def destroy @tracker.destroy if @tracker.status == :failed redirect_to admin_path(anchor: 'bundles') if @tracker[:job_class] == 'BundleUploadJob' redirect_to vendor_records_pat...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/controllers/admin/users_controller.rb
Ruby
apache-2.0
89
master
1,148
# frozen_string_literal: true module Admin class UsersController < AdminController def index redirect_to admin_path(anchor: 'user_management') end def edit add_breadcrumb 'Edit Users', :edit_users_path @user = User.find(params[:id]) end def show @user = User.find(params[...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/controllers/vendors/records_controller.rb
Ruby
apache-2.0
89
master
2,421
# frozen_string_literal: true module Vendors class RecordsController < ::RecordsController include PatientAnalysisHelper before_action :set_vendor, :authorize_vendor, :set_record_source def new @default = Bundle.find(params['default']) add_breadcrumb 'Add Patient', :new_admin_bundle_path, o...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/lib/job/status.rb
Ruby
apache-2.0
89
master
751
# frozen_string_literal: true module Job module Status extend ActiveSupport::Concern included do before_enqueue do |job| job.tracker.queued end around_perform do |job, block| job.tracker.working begin block.call job.tracker.finished jo...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/helpers/measures_helper.rb
Ruby
apache-2.0
89
master
2,620
# frozen_string_literal: true module MeasuresHelper def pick_measure_for_filtering_test(available_measures, bundle) bundle.measures.find_by(hqmf_id: pick_measure_id_for_filtering_test(available_measures, bundle)) end # Pick a measure from the choices for the C4 filtering tests. # Chooses a random measure ...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/helpers/application_helper.rb
Ruby
apache-2.0
89
master
3,484
# frozen_string_literal: true module ApplicationHelper def display_time(seconds_since_epoch) Time.at(seconds_since_epoch).in_time_zone.strftime('%B %e, %Y') || '?' end def display_time_to_minutes(seconds_since_epoch) Time.at(seconds_since_epoch).in_time_zone.strftime('%B %e, %Y %l:%M%P') end def we...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/helpers/xml_view_helper.rb
Ruby
apache-2.0
89
master
909
# frozen_string_literal: false module XmlViewHelper include Cypress::ErrorCollector # used for errors popup in node partial # returns title of popup, popup button text, and message in popup def popup_attributes(errors) return unless errors.count.positive? title = "Execution #{'Error'.pluralize(error...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/helpers/vendors_helper.rb
Ruby
apache-2.0
89
master
2,310
# frozen_string_literal: true module VendorsHelper include Cypress::ProductStatusValues def formatted_vendor_address(vendor) address = [vendor.address, vendor.state, vendor.zip].delete_if { |x| x == '' } address.count.positive? ? address.join(', ') : nil end # return value is nested hash structured l...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/helpers/filtering_tests_helper.rb
Ruby
apache-2.0
89
master
1,579
# frozen_string_literal: true module FilteringTestsHelper include ChecklistTestsHelper def display_filter_val(filter_name, randomization, vals) return [] if vals == [] # ie, the filter values haven't been chosen yet return providers_val(vals) if filter_name == 'providers' return problems_val(vals) if ...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/helpers/assets_helper.rb
Ruby
apache-2.0
89
master
1,416
# frozen_string_literal: true module AssetsHelper def inline_stylesheet(logical_name = 'application') css = read_css_asset(logical_name) return '' if css.blank? # tag.style comes from ActionView; wraps content with <style type="text/css">…</style> tag.style(css, type: 'text/css') end private ...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/helpers/records_helper.rb
Ruby
apache-2.0
89
master
9,415
# frozen_string_literal: true module RecordsHelper SECTIONS = %w[adverse_event allergy assessment care_experience care_goal communication condition device diagnostic_study encounter family_history functional_status immunization intervention laboratory_test medical_equipment medication...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/helpers/products_helper.rb
Ruby
apache-2.0
89
master
10,238
# frozen_string_literal: true # rubocop:disable Metrics/ModuleLength module ProductsHelper # used in product create def should_show_product_tests_tab?(product, test_type) case test_type when 'MeasureTest' product.c1_test || product.c2_test || product.c3_test when 'MultiMeasureTest' product....
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/helpers/test_executions_helper.rb
Ruby
apache-2.0
89
master
6,204
# frozen_string_literal: false module TestExecutionsHelper include TestExecutionsResultsHelper def displaying_cat1?(task) # A CMSProgramTask only uses the cat I upload when the reporting_program_type is eh task.is_a?(C1Task) || task.is_a?(Cat1FilterTask) || task.is_a?(C1ChecklistTask) || task.is_a?(MultiM...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/helpers/qrda_helper.rb
Ruby
apache-2.0
89
master
1,598
# frozen_string_literal: true module QrdaHelper def measure_ids_from_cat_1_file(doc) measure_ids = doc.xpath("//cda:entry/cda:organizer[./cda:templateId[@root='2.16.840.1.113883.10.20.24.3.98']]" \ "/cda:reference[@typeCode='REFR']/cda:externalDocument[@classCode='DOC']" \ ...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/helpers/version_config_helper.rb
Ruby
apache-2.0
89
master
1,802
# frozen_string_literal: true module VersionConfigHelper def config_for_version(bundle_version = Settings.current.default_bundle) versions = APP_CONSTANTS['version_config'].keys.map { |k| { spec: Gem::Dependency.new('', k), key: k } }.sort_by { |b| b[:key] }.reverse version = versions.select { |v| v.spec.mat...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/helpers/test_executions_results_helper.rb
Ruby
apache-2.0
89
master
5,224
# frozen_string_literal: false module TestExecutionsResultsHelper include ActionView::Helpers::TextHelper def get_select_history_message(execution, index, total_test_executions) execution_number = total_test_executions - index msg = '' msg << 'Most Recent - ' if index.zero? msg << "Upload #{execut...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/helpers/patient_analysis_helper.rb
Ruby
apache-2.0
89
master
9,841
# frozen_string_literal: true module PatientAnalysisHelper def collate_vs_info(codes_found, value_sets_found, vs_codes_found) codes_found.each do |dec| # find all valuesets that contain data element code vs = ValueSet.where('concepts.code' => dec.code).map { |vset| vset.id.to_s } value_sets_fou...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/helpers/checklist_tests_helper.rb
Ruby
apache-2.0
89
master
3,459
# frozen_string_literal: true module ChecklistTestsHelper def disable_qrda_submission? # only disable if none of the measures have all good checklist criteria @product_test.checked_criteria.group_by(&:measure_id).values.all? { |cc_group| cc_group.any? { |cc| !cc.checklist_complete } } end def checklist_...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/uploaders/supplement_uploader.rb
Ruby
apache-2.0
89
master
282
# frozen_string_literal: true class SupplementUploader < CarrierWave::Uploader::Base storage :file def store_dir "#{APP_CONSTANTS['file_upload_root']}/products/#{model.id}" end def extension_allowlist %w[doc docx xls xlsx ppt pptx jpg jpeg pdf png zip] end end
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/uploaders/document_uploader.rb
Ruby
apache-2.0
89
master
296
# frozen_string_literal: true class DocumentUploader < CarrierWave::Uploader::Base storage :file def store_dir "#{APP_CONSTANTS['file_upload_root']}/test_executions/#{model.id}" end def extension_allowlist %w[xml zip] end def uploaded_filename file.filename end end
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/uploaders/patient_archive_uploader.rb
Ruby
apache-2.0
89
master
250
# frozen_string_literal: true class PatientArchiveUploader < CarrierWave::Uploader::Base storage :file def store_dir "#{APP_CONSTANTS['file_upload_root']}/product_test/#{model.id}" end def uploaded_filename file.filename end end
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/jobs/vendor_patient_upload_job.rb
Ruby
apache-2.0
89
master
5,641
# frozen_string_literal: true class VendorPatientUploadJob < ApplicationJob include Job::Status include ::CqmValidators include ::Validators include QrdaHelper after_enqueue do |job| tracker = job.tracker tracker.options['original_filename'] = job.arguments[1] tracker.options['vendor_id'] = job....
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/jobs/single_measure_calculation_job.rb
Ruby
apache-2.0
89
master
1,204
# frozen_string_literal: true class SingleMeasureCalculationJob < ApplicationJob queue_as :measure_calculation include Job::Status def perform(patient_ids, measure_id, correlation_id, options) measure = Measure.find(measure_id) valueset_oids = measure.value_sets.distinct(:oid) patients = Patient.fin...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/jobs/bundle_upload_job.rb
Ruby
apache-2.0
89
master
3,349
# frozen_string_literal: true class BundleUploadJob < ApplicationJob include Job::Status DEFAULT_OPTIONS = { delete_existing: false, update_measures: false, exclude_results: false }.freeze after_enqueue do |job| tracker = job.tracker tracker.options['original_filename'] = job.arguments[1] tracker.sav...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/jobs/product_test_setup_job.rb
Ruby
apache-2.0
89
master
2,305
# frozen_string_literal: true class ProductTestSetupJob < ApplicationJob queue_as :product_test_setup include Job::Status def perform(product_test) product_test.building # Try to build a test deck. Retry 5 times if a test deck results in an IPP of 0 5.times do product_test.generate_patients(@j...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/jobs/bundle_deprecate_job.rb
Ruby
apache-2.0
89
master
505
# frozen_string_literal: true class BundleDeprecateJob < ApplicationJob include Job::Status after_enqueue do |job| tracker = job.tracker tracker.options['bundle_title'] = job.arguments[1] tracker.save end def perform(bundle_id, bundle_title) tracker.log("Deprecating #{bundle_title}") bundle...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/jobs/measure_evaluation_job.rb
Ruby
apache-2.0
89
master
1,497
# frozen_string_literal: true class MeasureEvaluationJob < ApplicationJob queue_as :default include Job::Status # The MeasureEvaluationJob aggregates Individual Results to calculated the expected results for a # Measure Test or Task # # @param [Object] test_or_task The ProductTest or Task being evalutated...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/jobs/patient_analysis_job.rb
Ruby
apache-2.0
89
master
566
# frozen_string_literal: true class PatientAnalysisJob < ApplicationJob include Job::Status include PatientAnalysisHelper after_enqueue do |job| tracker = job.tracker tracker.options['bundle_id'] = job.arguments[0] tracker.options['vendor_id'] = job.arguments[1] tracker.save end def perform...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/jobs/cms_test_execution_job.rb
Ruby
apache-2.0
89
master
6,406
# frozen_string_literal: true class CMSTestExecutionJob < ApplicationJob include Job::Status queue_as :default PATIENTS_PER_CALCUATION = 200 after_enqueue do |job| job.tracker.add_options(test_execution_id: job.arguments[0].id, task_id: job.arguments[1].id) end def perform...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/jobs/mpl_download_create_job.rb
Ruby
apache-2.0
89
master
565
# frozen_string_literal: true class MplDownloadCreateJob < ApplicationJob include Job::Status after_enqueue do |job| tracker = job.tracker tracker.options['bundle_id'] = job.arguments[0] tracker.save end def perform(bundle_id) tracker.log('Creating Download') bundle = Bundle.find(bundle_id)...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/jobs/test_execution_job.rb
Ruby
apache-2.0
89
master
610
# frozen_string_literal: true class TestExecutionJob < ApplicationJob include Job::Status queue_as :default after_enqueue do |job| job.tracker.add_options(test_execution_id: job.arguments[0].id, task_id: job.arguments[1].id) end def perform(test_execution, task, options = {})...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/jobs/bundle_destroy_job.rb
Ruby
apache-2.0
89
master
498
# frozen_string_literal: true class BundleDestroyJob < ApplicationJob include Job::Status after_enqueue do |job| tracker = job.tracker tracker.options['bundle_title'] = job.arguments[1] tracker.save end def perform(bundle_id, bundle_title) tracker.log("Removing #{bundle_title}") bundle = Bu...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/jobs/checklist_test_setup_job.rb
Ruby
apache-2.0
89
master
441
# frozen_string_literal: true class ChecklistTestSetupJob < ApplicationJob queue_as :product_test_setup include Job::Status def perform(checklist_test) # It is not necessary to monitor the status of this job, since this task # will be completed on the frontend if the users tries to download # criteri...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/jobs/filter_test_setup_job.rb
Ruby
apache-2.0
89
master
2,121
# frozen_string_literal: true class FilterTestSetupJob < ApplicationJob queue_as :filter_test_setup include Job::Status def perform(product) product = Product.find(product) add_filtering_tests(product) end def add_filtering_tests(product) measure = ApplicationController.helpers.pick_measure_for_...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/models/artifact.rb
Ruby
apache-2.0
89
master
3,316
# frozen_string_literal: false class Artifact include Enumerable include Mongoid::Document include Mongoid::Timestamps MIME_FILE_TYPES = { 'application/zip' => :zip, 'multipart/mixed' => :zip, 'application/x-zip-compressed' => :zip, 'application/x-compressed' => :zip, 'multipart/x-zip' =...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/models/settings.rb
Ruby
apache-2.0
89
master
8,738
# frozen_string_literal: true class Settings include Mongoid::Document # If you are adding a new field, you should add a default value here, however # note that you will also need to add a migration in order to setup the field # to a sane default value for existing users! Migrations are run every time # the...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/models/c3_checklist_task.rb
Ruby
apache-2.0
89
master
560
# frozen_string_literal: true class C3ChecklistTask < Task # include Mongoid::Attributes::Dynamic include ::Validators def validators @validators = [::Validators::QrdaCat1Validator.new(product_test.bundle, true, true, product_test.c1_test, product_test.measures)] @validators end def execute(file, u...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/models/role.rb
Ruby
apache-2.0
89
master
432
# frozen_string_literal: true class Role include Mongoid::Document has_and_belongs_to_many :users belongs_to :resource, polymorphic: true, optional: true field :name, type: String index({ name: 1, resource_type: 1, resource_id: 1 }, unique: true) validates :...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/models/measure_test.rb
Ruby
apache-2.0
89
master
2,099
# frozen_string_literal: true class MeasureTest < ProductTest before_validation :generate_provider belongs_to :provider, index: true validate :at_most_one_measure? def at_most_one_measure? errors.add(:measure_ids, 'MeasureTest must have a single measure id') if measure_ids.length != 1 end after_cre...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/models/ability.rb
Ruby
apache-2.0
89
master
1,848
# frozen_string_literal: true class Ability include CanCan::Ability def initialize(user) # user ||= User.new # We either have a user OR we create a default user # if user.atl? # can :manage, :all # end if user.user_role?('admin') can :manage, :all else can :manage, Vendor if...
github
projectcypress/cypress
https://github.com/projectcypress/cypress
app/models/multi_measure_cat3_task.rb
Ruby
apache-2.0
89
master
1,265
# frozen_string_literal: true class MultiMeasureCat3Task < Task def validators @validators = [::Validators::MeasurePeriodValidator.new, ::Validators::QrdaCat3Validator.new(product_test.expected_results, true, true, false, product_test.bundle), ::Validators::CMSQRDA3Schematro...