Skip to content

Commit

Permalink
core: drop 2016 cutoff from core tables
Browse files Browse the repository at this point in the history
  • Loading branch information
mikix committed Oct 3, 2024
1 parent b1a484c commit d35b17a
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,5 +134,4 @@ LEFT JOIN core__allergyintolerance_dn_code AS dn_code ON ta.id = dn_code.id
LEFT JOIN core__allergyintolerance_dn_clinical_status AS dn_cstat ON ta.id = dn_cstat.id
LEFT JOIN core__allergyintolerance_dn_verification_status AS dn_vstat
ON ta.id = dn_vstat.id
LEFT JOIN temp_category AS tcat ON ta.id = tcat.id
WHERE ta.recordedDate BETWEEN date('2016-01-01') AND current_date;
LEFT JOIN temp_category AS tcat ON ta.id = tcat.id;
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,4 @@ SELECT
FROM temp_condition AS tc
LEFT JOIN core__condition_dn_category AS cdc ON tc.id = cdc.id
LEFT JOIN core__condition_dn_clinical_status AS cdcs ON tc.id = cdcs.id
LEFT JOIN core__condition_dn_verification_status AS cdvs ON tc.id = cdvs.id
WHERE tc.recordedDate BETWEEN date('2016-01-01') AND current_date;
LEFT JOIN core__condition_dn_verification_status AS cdvs ON tc.id = cdvs.id;
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,4 @@ SELECT DISTINCT
te.encounter_ref,
concat('DocumentReference/', tdr.id) AS documentreference_ref
FROM temp_documentreference AS tdr
LEFT JOIN temp_encounters AS te ON tdr.id = te.id
WHERE date(tdr.author_day) BETWEEN date('2016-06-01') AND current_date;
LEFT JOIN temp_encounters AS te ON tdr.id = te.id;
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,4 @@ FROM temp_encounter AS e
LEFT JOIN core__fhir_mapping_expected_act_encounter_code_v3 AS eac
ON e.class_code = eac.found
LEFT JOIN core__fhir_act_encounter_code_v3 AS ac ON eac.expected = ac.code
INNER JOIN core__patient AS p ON e.subject_ref = p.subject_ref
WHERE
e.period_start_day BETWEEN date('2016-06-01') AND current_date;
INNER JOIN core__patient AS p ON e.subject_ref = p.subject_ref;
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,4 @@ SELECT
subject_ref,
encounter_ref,
concat('Observation/', id) AS observation_ref
FROM temp_observation
WHERE
effectiveDateTime_day BETWEEN date(
from_iso8601_timestamp('2016-06-01')
) AND current_date;
FROM temp_observation;
11 changes: 0 additions & 11 deletions tests/core/test_core_allergy.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,17 +229,6 @@ def test_core_allergy_many_cases(tmp_path):
assert expected_set == dict_set_from_list(rows)


def test_core_allergy_date_cutoff(tmp_path):
"""Verify that we ignore rows before 2016"""
testbed = testbed_utils.LocalTestbed(tmp_path)
testbed.add_allergy_intolerance("Old", recorded="2015")
testbed.add_allergy_intolerance("New", recorded="2016")

con = testbed.build()
df = con.sql("SELECT id FROM core__allergyintolerance").df()
assert ["New"] == list(df.id)


@mock.patch("cumulus_library.builders.counts.DEFAULT_MIN_SUBJECT", new=1)
def test_core_count_allergy_intolerance_by_patient(tmp_path):
"""Verify that our basic allergy count is per-patient"""
Expand Down

0 comments on commit d35b17a

Please sign in to comment.