projectcypress/health-data-standards

View on GitHub
test/unit/import/cat1/patient_importer_test.rb

Summary

Maintainability
C
1 day
Test Coverage

Class PatientImporterTest has 29 methods (exceeds 20 allowed). Consider refactoring.
Open

class PatientImporterTest < Minitest::Test

  def test_care_goal
    patient = build_record_from_xml('test/fixtures/cat1_fragments/care_goal_fragment.xml')
    care_goal = patient.care_goals.first
Severity: Minor
Found in test/unit/import/cat1/patient_importer_test.rb - About 3 hrs to fix

    Similar blocks of code found in 9 locations. Consider refactoring.
    Open

      def test_medication_administered
        patient = build_record_from_xml('test/fixtures/cat1_fragments/medication_admin_fragment.xml')
        med_admin = patient.medications.first
        expected_start = HealthDataStandards::Util::HL7Helper.timestamp_to_integer('20061203201716')
        expected_end = HealthDataStandards::Util::HL7Helper.timestamp_to_integer('20061204072502')
    Severity: Major
    Found in test/unit/import/cat1/patient_importer_test.rb and 8 other locations - About 35 mins to fix
    test/unit/import/cat1/patient_importer_test.rb on lines 90..97
    test/unit/import/cat1/patient_importer_test.rb on lines 100..107
    test/unit/import/cat1/patient_importer_test.rb on lines 110..117
    test/unit/import/cat1/patient_importer_test.rb on lines 162..169
    test/unit/import/cat1/patient_importer_test.rb on lines 197..204
    test/unit/import/cat1/patient_importer_test.rb on lines 216..223
    test/unit/import/cat1/patient_importer_test.rb on lines 226..233
    test/unit/import/cat1/patient_importer_test.rb on lines 236..243

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 36.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 9 locations. Consider refactoring.
    Open

      def test_diagnostic_study_performed
        patient = build_record_from_xml('test/fixtures/cat1_fragments/diagnostic_study_performed_fragment.xml')
        diag_study_performed = patient.procedures.first
        expected_start = HealthDataStandards::Util::HL7Helper.timestamp_to_integer('20081029211606')
        expected_end = HealthDataStandards::Util::HL7Helper.timestamp_to_integer('20081029230540')
    Severity: Major
    Found in test/unit/import/cat1/patient_importer_test.rb and 8 other locations - About 35 mins to fix
    test/unit/import/cat1/patient_importer_test.rb on lines 90..97
    test/unit/import/cat1/patient_importer_test.rb on lines 100..107
    test/unit/import/cat1/patient_importer_test.rb on lines 110..117
    test/unit/import/cat1/patient_importer_test.rb on lines 128..135
    test/unit/import/cat1/patient_importer_test.rb on lines 162..169
    test/unit/import/cat1/patient_importer_test.rb on lines 197..204
    test/unit/import/cat1/patient_importer_test.rb on lines 216..223
    test/unit/import/cat1/patient_importer_test.rb on lines 236..243

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 36.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 9 locations. Consider refactoring.
    Open

      def test_medication_order
        patient = build_record_from_xml('test/fixtures/cat1_fragments/medication_order_fragment.xml')
        med_order = patient.medications.first
        expected_start = HealthDataStandards::Util::HL7Helper.timestamp_to_integer('20000328001401')
        expected_end = HealthDataStandards::Util::HL7Helper.timestamp_to_integer('20000328012924')
    Severity: Major
    Found in test/unit/import/cat1/patient_importer_test.rb and 8 other locations - About 35 mins to fix
    test/unit/import/cat1/patient_importer_test.rb on lines 90..97
    test/unit/import/cat1/patient_importer_test.rb on lines 100..107
    test/unit/import/cat1/patient_importer_test.rb on lines 110..117
    test/unit/import/cat1/patient_importer_test.rb on lines 128..135
    test/unit/import/cat1/patient_importer_test.rb on lines 197..204
    test/unit/import/cat1/patient_importer_test.rb on lines 216..223
    test/unit/import/cat1/patient_importer_test.rb on lines 226..233
    test/unit/import/cat1/patient_importer_test.rb on lines 236..243

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 36.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 9 locations. Consider refactoring.
    Open

      def test_diagnosis_resolved
        patient = build_record_from_xml('test/fixtures/cat1_fragments/diagnosis_resolved_fragment.xml')
        diag_resolved = patient.conditions.first
        expected_start = HealthDataStandards::Util::HL7Helper.timestamp_to_integer('20030403010254')
        expected_end = HealthDataStandards::Util::HL7Helper.timestamp_to_integer('20030403121452')
    Severity: Major
    Found in test/unit/import/cat1/patient_importer_test.rb and 8 other locations - About 35 mins to fix
    test/unit/import/cat1/patient_importer_test.rb on lines 90..97
    test/unit/import/cat1/patient_importer_test.rb on lines 100..107
    test/unit/import/cat1/patient_importer_test.rb on lines 110..117
    test/unit/import/cat1/patient_importer_test.rb on lines 128..135
    test/unit/import/cat1/patient_importer_test.rb on lines 162..169
    test/unit/import/cat1/patient_importer_test.rb on lines 197..204
    test/unit/import/cat1/patient_importer_test.rb on lines 216..223
    test/unit/import/cat1/patient_importer_test.rb on lines 226..233

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 36.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 9 locations. Consider refactoring.
    Open

      def test_intervention_performed
        patient = build_record_from_xml('test/fixtures/cat1_fragments/intervention_performed_fragment.xml')
        intervention_performed = patient.procedures.first
        expected_start = HealthDataStandards::Util::HL7Helper.timestamp_to_integer('20100205120000')
        expected_end = HealthDataStandards::Util::HL7Helper.timestamp_to_integer('20100205120000')
    Severity: Major
    Found in test/unit/import/cat1/patient_importer_test.rb and 8 other locations - About 35 mins to fix
    test/unit/import/cat1/patient_importer_test.rb on lines 100..107
    test/unit/import/cat1/patient_importer_test.rb on lines 110..117
    test/unit/import/cat1/patient_importer_test.rb on lines 128..135
    test/unit/import/cat1/patient_importer_test.rb on lines 162..169
    test/unit/import/cat1/patient_importer_test.rb on lines 197..204
    test/unit/import/cat1/patient_importer_test.rb on lines 216..223
    test/unit/import/cat1/patient_importer_test.rb on lines 226..233
    test/unit/import/cat1/patient_importer_test.rb on lines 236..243

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 36.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 9 locations. Consider refactoring.
    Open

      def test_functional_status_result
        patient = build_record_from_xml('test/fixtures/cat1_fragments/functional_status_result_fragment.xml')
        func_stat_result = patient.results.first
        expected_start = HealthDataStandards::Util::HL7Helper.timestamp_to_integer('19881027090442')
        expected_end = HealthDataStandards::Util::HL7Helper.timestamp_to_integer('19881028024912')
    Severity: Major
    Found in test/unit/import/cat1/patient_importer_test.rb and 8 other locations - About 35 mins to fix
    test/unit/import/cat1/patient_importer_test.rb on lines 90..97
    test/unit/import/cat1/patient_importer_test.rb on lines 100..107
    test/unit/import/cat1/patient_importer_test.rb on lines 110..117
    test/unit/import/cat1/patient_importer_test.rb on lines 128..135
    test/unit/import/cat1/patient_importer_test.rb on lines 162..169
    test/unit/import/cat1/patient_importer_test.rb on lines 216..223
    test/unit/import/cat1/patient_importer_test.rb on lines 226..233
    test/unit/import/cat1/patient_importer_test.rb on lines 236..243

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 36.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 9 locations. Consider refactoring.
    Open

      def test_diagnostic_study_result
        patient = build_record_from_xml('test/fixtures/cat1_fragments/diagnostic_study_result_fragment.xml')
        diag_study_result = patient.procedures.first
        expected_start = HealthDataStandards::Util::HL7Helper.timestamp_to_integer('19890923063243')
        expected_end = HealthDataStandards::Util::HL7Helper.timestamp_to_integer('19890923101231')
    Severity: Major
    Found in test/unit/import/cat1/patient_importer_test.rb and 8 other locations - About 35 mins to fix
    test/unit/import/cat1/patient_importer_test.rb on lines 90..97
    test/unit/import/cat1/patient_importer_test.rb on lines 100..107
    test/unit/import/cat1/patient_importer_test.rb on lines 110..117
    test/unit/import/cat1/patient_importer_test.rb on lines 128..135
    test/unit/import/cat1/patient_importer_test.rb on lines 162..169
    test/unit/import/cat1/patient_importer_test.rb on lines 197..204
    test/unit/import/cat1/patient_importer_test.rb on lines 226..233
    test/unit/import/cat1/patient_importer_test.rb on lines 236..243

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 36.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 9 locations. Consider refactoring.
    Open

      def test_intervention_result
        patient = build_record_from_xml('test/fixtures/cat1_fragments/intervention_result_fragment.xml')
        intervention_result = patient.results.first
        expected_start = HealthDataStandards::Util::HL7Helper.timestamp_to_integer('20041016152724')
        expected_end = HealthDataStandards::Util::HL7Helper.timestamp_to_integer('20041016204832')
    Severity: Major
    Found in test/unit/import/cat1/patient_importer_test.rb and 8 other locations - About 35 mins to fix
    test/unit/import/cat1/patient_importer_test.rb on lines 90..97
    test/unit/import/cat1/patient_importer_test.rb on lines 110..117
    test/unit/import/cat1/patient_importer_test.rb on lines 128..135
    test/unit/import/cat1/patient_importer_test.rb on lines 162..169
    test/unit/import/cat1/patient_importer_test.rb on lines 197..204
    test/unit/import/cat1/patient_importer_test.rb on lines 216..223
    test/unit/import/cat1/patient_importer_test.rb on lines 226..233
    test/unit/import/cat1/patient_importer_test.rb on lines 236..243

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 36.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 9 locations. Consider refactoring.
    Open

      def test_lab_performed
        patient = build_record_from_xml('test/fixtures/cat1_fragments/lab_performed_fragment.xml')
        lab_performed = patient.results.first
        expected_start = HealthDataStandards::Util::HL7Helper.timestamp_to_integer('20020129180704')
        expected_end = HealthDataStandards::Util::HL7Helper.timestamp_to_integer('20020130074815')
    Severity: Major
    Found in test/unit/import/cat1/patient_importer_test.rb and 8 other locations - About 35 mins to fix
    test/unit/import/cat1/patient_importer_test.rb on lines 90..97
    test/unit/import/cat1/patient_importer_test.rb on lines 100..107
    test/unit/import/cat1/patient_importer_test.rb on lines 128..135
    test/unit/import/cat1/patient_importer_test.rb on lines 162..169
    test/unit/import/cat1/patient_importer_test.rb on lines 197..204
    test/unit/import/cat1/patient_importer_test.rb on lines 216..223
    test/unit/import/cat1/patient_importer_test.rb on lines 226..233
    test/unit/import/cat1/patient_importer_test.rb on lines 236..243

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 36.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 7 locations. Consider refactoring.
    Open

      def test_comm_patient_to_prov
        patient = build_record_from_xml('test/fixtures/cat1_fragments/comm_patient_to_provider_fragment.xml')
        communication = patient.communications.first
        expected_start = HealthDataStandards::Util::HL7Helper.timestamp_to_integer('20101027165345')
        assert communication.codes['SNOMED-CT'].include?('315640000')
    Severity: Minor
    Found in test/unit/import/cat1/patient_importer_test.rb and 6 other locations - About 15 mins to fix
    test/unit/import/cat1/patient_importer_test.rb on lines 66..71
    test/unit/import/cat1/patient_importer_test.rb on lines 82..87
    test/unit/import/cat1/patient_importer_test.rb on lines 120..125
    test/unit/import/cat1/patient_importer_test.rb on lines 138..143
    test/unit/import/cat1/patient_importer_test.rb on lines 146..151
    test/unit/import/cat1/patient_importer_test.rb on lines 154..159

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 26.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 7 locations. Consider refactoring.
    Open

        def test_medication_adverse
        patient = build_record_from_xml('test/fixtures/cat1_fragments/medication_adverse_fragment.xml')
        med_adverse = patient.allergies.first
        expected_start = HealthDataStandards::Util::HL7Helper.timestamp_to_integer('20070520173120')
        assert med_adverse.codes['RxNorm'].include?('998695')
    Severity: Minor
    Found in test/unit/import/cat1/patient_importer_test.rb and 6 other locations - About 15 mins to fix
    test/unit/import/cat1/patient_importer_test.rb on lines 66..71
    test/unit/import/cat1/patient_importer_test.rb on lines 74..79
    test/unit/import/cat1/patient_importer_test.rb on lines 82..87
    test/unit/import/cat1/patient_importer_test.rb on lines 120..125
    test/unit/import/cat1/patient_importer_test.rb on lines 138..143
    test/unit/import/cat1/patient_importer_test.rb on lines 146..151

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 26.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 7 locations. Consider refactoring.
    Open

      def test_medication_allergy
        patient = build_record_from_xml('test/fixtures/cat1_fragments/medication_allergy_fragment.xml')
        med_allergy = patient.allergies.first
        expected_start = HealthDataStandards::Util::HL7Helper.timestamp_to_integer('19790809140056')
        assert med_allergy.codes['RxNorm'].include?('996994')
    Severity: Minor
    Found in test/unit/import/cat1/patient_importer_test.rb and 6 other locations - About 15 mins to fix
    test/unit/import/cat1/patient_importer_test.rb on lines 66..71
    test/unit/import/cat1/patient_importer_test.rb on lines 74..79
    test/unit/import/cat1/patient_importer_test.rb on lines 82..87
    test/unit/import/cat1/patient_importer_test.rb on lines 120..125
    test/unit/import/cat1/patient_importer_test.rb on lines 138..143
    test/unit/import/cat1/patient_importer_test.rb on lines 154..159

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 26.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 7 locations. Consider refactoring.
    Open

      def test_medication_intolerance
        patient = build_record_from_xml('test/fixtures/cat1_fragments/medication_intolerance_fragment.xml')
        med_intolerance = patient.allergies.first
        expected_start = HealthDataStandards::Util::HL7Helper.timestamp_to_integer('20061203201716')
        assert med_intolerance.codes['RxNorm'].include?('998695')
    Severity: Minor
    Found in test/unit/import/cat1/patient_importer_test.rb and 6 other locations - About 15 mins to fix
    test/unit/import/cat1/patient_importer_test.rb on lines 66..71
    test/unit/import/cat1/patient_importer_test.rb on lines 74..79
    test/unit/import/cat1/patient_importer_test.rb on lines 82..87
    test/unit/import/cat1/patient_importer_test.rb on lines 120..125
    test/unit/import/cat1/patient_importer_test.rb on lines 146..151
    test/unit/import/cat1/patient_importer_test.rb on lines 154..159

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 26.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 7 locations. Consider refactoring.
    Open

      def test_comm_prov_to_prov
        patient = build_record_from_xml('test/fixtures/cat1_fragments/comm_provider_to_provider_fragment.xml')
        communication = patient.communications.first
        expected_start = HealthDataStandards::Util::HL7Helper.timestamp_to_integer('19810627142601')
        assert communication.codes['SNOMED-CT'].include?('371545006')
    Severity: Minor
    Found in test/unit/import/cat1/patient_importer_test.rb and 6 other locations - About 15 mins to fix
    test/unit/import/cat1/patient_importer_test.rb on lines 66..71
    test/unit/import/cat1/patient_importer_test.rb on lines 74..79
    test/unit/import/cat1/patient_importer_test.rb on lines 82..87
    test/unit/import/cat1/patient_importer_test.rb on lines 138..143
    test/unit/import/cat1/patient_importer_test.rb on lines 146..151
    test/unit/import/cat1/patient_importer_test.rb on lines 154..159

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 26.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 7 locations. Consider refactoring.
    Open

      def test_comm_prov_to_patient
        patient = build_record_from_xml('test/fixtures/cat1_fragments/comm_prov_to_patient_fragment.xml')
        communication = patient.communications.first
        expected_start = HealthDataStandards::Util::HL7Helper.timestamp_to_integer('20100605220000')
        assert communication.codes['LOINC'].include?('69981-9')
    Severity: Minor
    Found in test/unit/import/cat1/patient_importer_test.rb and 6 other locations - About 15 mins to fix
    test/unit/import/cat1/patient_importer_test.rb on lines 74..79
    test/unit/import/cat1/patient_importer_test.rb on lines 82..87
    test/unit/import/cat1/patient_importer_test.rb on lines 120..125
    test/unit/import/cat1/patient_importer_test.rb on lines 138..143
    test/unit/import/cat1/patient_importer_test.rb on lines 146..151
    test/unit/import/cat1/patient_importer_test.rb on lines 154..159

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 26.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 7 locations. Consider refactoring.
    Open

      def test_intervention_order
        patient = build_record_from_xml('test/fixtures/cat1_fragments/intervention_order_fragment.xml')
        intervention_order = patient.procedures.first
        expected_start = HealthDataStandards::Util::HL7Helper.timestamp_to_integer('20100625000000')
        assert intervention_order.codes['SNOMED-CT'].include?('304549008')
    Severity: Minor
    Found in test/unit/import/cat1/patient_importer_test.rb and 6 other locations - About 15 mins to fix
    test/unit/import/cat1/patient_importer_test.rb on lines 66..71
    test/unit/import/cat1/patient_importer_test.rb on lines 74..79
    test/unit/import/cat1/patient_importer_test.rb on lines 120..125
    test/unit/import/cat1/patient_importer_test.rb on lines 138..143
    test/unit/import/cat1/patient_importer_test.rb on lines 146..151
    test/unit/import/cat1/patient_importer_test.rb on lines 154..159

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 26.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

      def test_procedure_performed
        patient = build_record_from_xml('test/fixtures/cat1_fragments/procedure_performed_fragment.xml')
        procedure_performed = patient.procedures.first
        assert procedure_performed.codes['CPT'].include?('55876')
        expected_start = HealthDataStandards::Util::HL7Helper.timestamp_to_integer('19860117151405')
    Severity: Minor
    Found in test/unit/import/cat1/patient_importer_test.rb and 1 other location - About 15 mins to fix
    test/unit/import/cat1/patient_importer_test.rb on lines 40..45

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 26.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

      def test_procedure_result
        patient = build_record_from_xml('test/fixtures/cat1_fragments/procedure_result_fragment.xml')
        procedure_result = patient.procedures.first
        assert procedure_result.codes['SNOMED-CT'].include?('116783008')
        expected_start = HealthDataStandards::Util::HL7Helper.timestamp_to_integer('20011202034746')
    Severity: Minor
    Found in test/unit/import/cat1/patient_importer_test.rb and 1 other location - About 15 mins to fix
    test/unit/import/cat1/patient_importer_test.rb on lines 32..37

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 26.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    There are no issues that match your filters.

    Category
    Status