lib/validators.rb in cqm-validators-0.1.1 vs lib/validators.rb in cqm-validators-1.0.1.0

- old
+ new

@@ -1,136 +1,70 @@ +# frozen_string_literal: true + require_relative 'validation_error' require_relative 'base_validator' require_relative 'schema_validator' require_relative 'schematron_validator' require_relative 'measure_validator' require_relative 'data_validator' require_relative 'performance_rate_validator' require_relative 'qrda_qdm_template_validator' module CqmValidators + CDA_SDTC_SCHEMA = 'lib/schema/infrastructure/cda/CDA_SDTC.xsd' + QRDA_CAT1_R5_SCHEMATRON = 'lib/schematron/qrda/cat_1_r5/HL7 QRDA Category I STU 5.sch' + QRDA_CAT1_R51_SCHEMATRON = 'lib/schematron/qrda/cat_1_r5_1/HL7 QRDA Category I STU 5.1.sch' + QRDA_CAT3_21SCHEMATRON = 'lib/schematron/qrda/cat_3_r2_1/HL7 QRDA Category III STU 2.1.sch' + BASE_DIR = File.expand_path('..', __dir__) - CDA_SDTC_SCHEMA = 'lib/schema/infrastructure/cda/CDA_SDTC.xsd' - QRDA_CAT1_SCHEMATRON = 'lib/schematron/qrda/cat_1_r2/QRDA Category I Release 2.sch' - QRDA_CAT1_R3_SCHEMATRON = 'lib/schematron/qrda/cat_1/HL7_CDAR2_QRDA_Category_I_2_12_16.sch' - QRDA_CAT1_R3_1_SCHEMATRON = 'lib/schematron/qrda/cat_1_r3_1/HL7 QRDA Category I STU 3.1.sch' - QRDA_CAT1_R4_SCHEMATRON = 'lib/schematron/qrda/cat_1_r4/HL7 QRDA Category I STU 4.sch' - QRDA_CAT1_R5_SCHEMATRON = 'lib/schematron/qrda/cat_1_r5/HL7 QRDA Category I STU 5.sch' - QRDA_CAT3_SCHEMATRON = 'lib/schematron/qrda/cat_3/QRDA Category III.sch' - QRDA_CAT3_1_1SCHEMATRON = 'lib/schematron/qrda/cat_3_r1_1/HL7 QRDA Category III STU 1.1.sch' - QRDA_CAT3_2SCHEMATRON = 'lib/schematron/qrda/cat_3_r2/HL7 QRDA Category III STU 2.sch' - QRDA_CAT3_21SCHEMATRON = 'lib/schematron/qrda/cat_3_r2_1/HL7 QRDA Category III STU 2.1.sch' - BASE_DIR = File.expand_path("../../", __FILE__) + class Cat1Measure < MeasureValidator + include Singleton - class Cat1Measure < MeasureValidator - include Singleton - - def initialize() - super("2.16.840.1.113883.10.20.24.3.97") - end - + def initialize + super('2.16.840.1.113883.10.20.24.3.97') end + end - class Cat3Measure < MeasureValidator - include Singleton + class Cat3Measure < MeasureValidator + include Singleton - def initialize() - super("2.16.840.1.113883.10.20.27.3.1") - end - + def initialize + super('2.16.840.1.113883.10.20.27.3.1') end + end - class CDA < Schema::Validator - include Singleton + class CDA < Schema::Validator + include Singleton - def initialize - super("CDA SDTC Validator", File.join(BASE_DIR, CDA_SDTC_SCHEMA)) - end - + def initialize + super('CDA SDTC Validator', File.join(BASE_DIR, CDA_SDTC_SCHEMA)) end + end - class Cat1 < Schematron::Validator - include Singleton + class Cat1R5 < Schematron::Validator + include Singleton - def initialize - super("QRDA Cat 1 R3 Validator", File.join(BASE_DIR, QRDA_CAT1_R3_SCHEMATRON)) - end - + def initialize + super('QRDA Cat 1 Validator', File.join(BASE_DIR, QRDA_CAT1_R5_SCHEMATRON)) end + end - class Cat1R2 < Schematron::Validator - include Singleton + class Cat1R51 < Schematron::Validator + include Singleton - def initialize - super("QRDA Cat 1 Validator", File.join(BASE_DIR, QRDA_CAT1_SCHEMATRON)) - end - + def initialize + super('QRDA Cat 1 Validator', File.join(BASE_DIR, QRDA_CAT1_R51_SCHEMATRON)) end + end - class Cat1R31 < Schematron::Validator - include Singleton + class Cat3R21 < Schematron::Validator + include Singleton - def initialize - super("QRDA Cat 1 Validator", File.join(BASE_DIR, QRDA_CAT1_R3_1_SCHEMATRON)) - end - + def initialize + super('QRDA Cat 3 Validator', File.join(BASE_DIR, QRDA_CAT3_21SCHEMATRON)) end + end - class Cat1R4 < Schematron::Validator - include Singleton - - def initialize - super("QRDA Cat 1 Validator", File.join(BASE_DIR, QRDA_CAT1_R4_SCHEMATRON)) - end - - end - - class Cat1R5 < Schematron::Validator - include Singleton - - def initialize - super("QRDA Cat 1 Validator", File.join(BASE_DIR, QRDA_CAT1_R5_SCHEMATRON)) - end - - end - - class Cat3 < Schematron::Validator - include Singleton - - def initialize - super("QRDA Cat 3 Validator", File.join(BASE_DIR, QRDA_CAT3_SCHEMATRON)) - end - end - - class Cat3R11 < Schematron::Validator - include Singleton - - def initialize - super("QRDA Cat 3 Validator", File.join(BASE_DIR, QRDA_CAT3_1_1SCHEMATRON)) - end - end - - class Cat3R2 < Schematron::Validator - include Singleton - - def initialize - super("QRDA Cat 3 Validator", File.join(BASE_DIR, QRDA_CAT3_2SCHEMATRON)) - end - end - - class Cat3R21 < Schematron::Validator - include Singleton - - def initialize - super("QRDA Cat 3 Validator", File.join(BASE_DIR, QRDA_CAT3_21SCHEMATRON)) - end - end - - class Cat3PerformanceRate < PerformanceRateValidator - include Singleton - - #def initialize - # super("Performance Rate Validator", File.join(BASE_DIR, CDA_SDTC_SCHEMA)) - #end - - end + class Cat3PerformanceRate < PerformanceRateValidator + include Singleton + end end