diff --git a/cumulus_library/studies/core/builder_patient.py b/cumulus_library/studies/core/builder_patient.py index 253515df..9e5bfb82 100644 --- a/cumulus_library/studies/core/builder_patient.py +++ b/cumulus_library/studies/core/builder_patient.py @@ -18,9 +18,49 @@ class PatientBuilder(BaseTableBuilder): display_text = "Creating Patient tables..." + @staticmethod + def make_extension_query( + schema: str, + cursor: databases.DatabaseCursor, + parser: databases.DatabaseParser, + name: str, + url: str, + ) -> str: + has_extensions = sql_utils.is_field_present( + schema=schema, + cursor=cursor, + parser=parser, + source_table="patient", + source_col="extension", + expected={ + "extension": { + "url": {}, + "valueCoding": sql_utils.CODING, + }, + "url": {}, + }, + ) + if has_extensions: + config = sql_utils.ExtensionConfig( + source_table="patient", + source_id="id", + target_table=f"core__patient_ext_{name}", + target_col_prefix=name, + fhir_extension=url, + ext_systems=["ombCategory", "detailed"], + is_array=True, + ) + return base_templates.get_extension_denormalize_query(config) + else: + return base_templates.get_ctas_empty_query( + schema_name=schema, + table_name=f"core__patient_ext_{name}", + table_cols=["id", "system", f"{name}_code", f"{name}_display"], + ) + def prepare_queries( self, - cursor: object, + cursor: databases.DatabaseCursor, schema: str, *args, parser: databases.DatabaseParser = None, @@ -41,18 +81,13 @@ def prepare_queries( "fhirpath": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity", }, ] - for extension in extension_types: - config = sql_utils.ExtensionConfig( - source_table="patient", - source_id="id", - target_table=f"core__patient_ext_{extension['name']}", - target_col_prefix=extension["name"], - fhir_extension=extension["fhirpath"], - ext_systems=["ombCategory", "detailed", "text"], - is_array=True, + self.queries.append( + self.make_extension_query( + schema, cursor, parser, extension["name"], extension["fhirpath"] + ) ) - self.queries.append(base_templates.get_extension_denormalize_query(config)) + validated_schema = sql_utils.validate_schema( cursor, schema, expected_table_cols, parser ) diff --git a/cumulus_library/studies/core/reference_sql/builder_condition.sql b/cumulus_library/studies/core/reference_sql/builder_condition.sql index fcb6b80f..e0c2740e 100644 --- a/cumulus_library/studies/core/reference_sql/builder_condition.sql +++ b/cumulus_library/studies/core/reference_sql/builder_condition.sql @@ -419,7 +419,6 @@ CREATE TABLE core__condition AS WITH temp_condition AS ( SELECT c.id, - c.category, c.subject.reference AS subject_ref, c.encounter.reference AS encounter_ref, cca.code, @@ -431,9 +430,7 @@ WITH temp_condition AS ( date_trunc('month', date(from_iso8601_timestamp(c."recordedDate"))) AS recordedDate_month, date_trunc('year', date(from_iso8601_timestamp(c."recordedDate"))) - AS recordedDate_year, - c.verificationStatus, - c.clinicalStatus + AS recordedDate_year FROM condition AS c LEFT JOIN core__condition_codable_concepts_all AS cca ON c.id = cca.id ) diff --git a/cumulus_library/studies/core/reference_sql/builder_documentreference.sql b/cumulus_library/studies/core/reference_sql/builder_documentreference.sql index afeb8ca8..e8fdb4b5 100644 --- a/cumulus_library/studies/core/reference_sql/builder_documentreference.sql +++ b/cumulus_library/studies/core/reference_sql/builder_documentreference.sql @@ -153,7 +153,6 @@ CREATE TABLE core__documentreference AS WITH temp_documentreference AS ( SELECT DISTINCT dr.id, - dr.type, dr.status, dr.docStatus, dr.context, diff --git a/cumulus_library/studies/core/reference_sql/builder_encounter.sql b/cumulus_library/studies/core/reference_sql/builder_encounter.sql index 8ae6ba58..0c6180b0 100644 --- a/cumulus_library/studies/core/reference_sql/builder_encounter.sql +++ b/cumulus_library/studies/core/reference_sql/builder_encounter.sql @@ -273,9 +273,9 @@ CREATE TABLE IF NOT EXISTS "main"."core__encounter_dn_servicetype" AS ( SELECT * FROM ( VALUES - (cast(NULL AS varchar),cast(NULL AS varchar),cast(NULL AS varchar),cast(NULL AS varchar)) + (cast(NULL AS varchar),cast(NULL AS bigint),cast(NULL AS varchar),cast(NULL AS varchar),cast(NULL AS varchar)) ) - AS t ("id","code","code_system","display") + AS t ("id","row","code","code_system","display") WHERE 1 = 0 -- ensure empty table ); @@ -285,9 +285,9 @@ CREATE TABLE IF NOT EXISTS "main"."core__encounter_dn_priority" AS ( SELECT * FROM ( VALUES - (cast(NULL AS varchar),cast(NULL AS varchar),cast(NULL AS varchar),cast(NULL AS varchar)) + (cast(NULL AS varchar),cast(NULL AS bigint),cast(NULL AS varchar),cast(NULL AS varchar),cast(NULL AS varchar)) ) - AS t ("id","code","code_system","display") + AS t ("id","row","code","code_system","display") WHERE 1 = 0 -- ensure empty table ); @@ -571,9 +571,9 @@ temp_encounter_nullable AS ( SELECT DISTINCT e.id, e.status, - e.class, + e.class.code AS class_code, + e.class.system AS class_code_system, e.subject.reference AS subject_ref, - e.period, date(from_iso8601_timestamp(e.period.start)) AS period_start, date_trunc('day', date(from_iso8601_timestamp(e."period"."end"))) AS period_end_day, @@ -598,7 +598,8 @@ temp_encounter AS ( SELECT DISTINCT e.id, e.status, - e.class, + e.class_code, + e.class_code_system, e.subject_ref, e.period_start, e.period_start_day, @@ -664,7 +665,7 @@ SELECT DISTINCT concat('Encounter/', e.id) AS encounter_ref FROM temp_encounter AS e LEFT JOIN core__fhir_mapping_expected_act_encounter_code_v3 AS eac - ON e.class.code = eac.found + 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 diff --git a/cumulus_library/studies/core/reference_sql/builder_medicationrequest.sql b/cumulus_library/studies/core/reference_sql/builder_medicationrequest.sql index 52ee94bc..3b2b0213 100644 --- a/cumulus_library/studies/core/reference_sql/builder_medicationrequest.sql +++ b/cumulus_library/studies/core/reference_sql/builder_medicationrequest.sql @@ -100,7 +100,6 @@ WITH temp_mr AS ( date(from_iso8601_timestamp(mr.authoredOn)) AS authoredOn, date_trunc('month', date(from_iso8601_timestamp(mr."authoredOn"))) AS authoredOn_month, - cast(NULL as varchar) AS display, mr.reportedBoolean, mr.dosageInstruction, mr.subject.reference AS subject_ref, diff --git a/cumulus_library/studies/core/reference_sql/builder_observation.sql b/cumulus_library/studies/core/reference_sql/builder_observation.sql index d9f7a226..0a24dd33 100644 --- a/cumulus_library/studies/core/reference_sql/builder_observation.sql +++ b/cumulus_library/studies/core/reference_sql/builder_observation.sql @@ -244,9 +244,9 @@ CREATE TABLE IF NOT EXISTS "main"."core__observation_component_valuecodeableconc AS ( SELECT * FROM ( VALUES - (cast(NULL AS varchar),cast(NULL AS varchar),cast(NULL AS varchar),cast(NULL AS varchar)) + (cast(NULL AS varchar),cast(NULL AS bigint),cast(NULL AS varchar),cast(NULL AS varchar),cast(NULL AS varchar)) ) - AS t ("id","code","code_system","display") + AS t ("id","row","code","code_system","display") WHERE 1 = 0 -- ensure empty table ); @@ -256,9 +256,9 @@ CREATE TABLE IF NOT EXISTS "main"."core__observation_dn_interpretation" AS ( SELECT * FROM ( VALUES - (cast(NULL AS varchar),cast(NULL AS varchar),cast(NULL AS varchar),cast(NULL AS varchar)) + (cast(NULL AS varchar),cast(NULL AS bigint),cast(NULL AS varchar),cast(NULL AS varchar),cast(NULL AS varchar)) ) - AS t ("id","code","code_system","display") + AS t ("id","row","code","code_system","display") WHERE 1 = 0 -- ensure empty table ); @@ -304,9 +304,9 @@ CREATE TABLE IF NOT EXISTS "main"."core__observation_dn_dataabsentreason" AS ( SELECT * FROM ( VALUES - (cast(NULL AS varchar),cast(NULL AS varchar),cast(NULL AS varchar),cast(NULL AS varchar)) + (cast(NULL AS varchar),cast(NULL AS bigint),cast(NULL AS varchar),cast(NULL AS varchar),cast(NULL AS varchar)) ) - AS t ("id","code","code_system","display") + AS t ("id","row","code","code_system","display") WHERE 1 = 0 -- ensure empty table ); @@ -319,6 +319,8 @@ WITH temp_observation AS ( SELECT o.id, o.status, + o.encounter.reference AS encounter_ref, + o.subject.reference AS subject_ref, o.valueString, o.valueQuantity.value AS valueQuantity_value, o.valueQuantity.comparator AS valueQuantity_comparator, @@ -345,9 +347,7 @@ WITH temp_observation AS ( odvcc.display AS valueCodeableConcept_display, odda.code AS dataAbsentReason_code, odda.code_system AS dataAbsentReason_code_system, - odda.display AS dataAbsentReason_display, - o.subject.reference AS subject_ref, - o.encounter.reference AS encounter_ref + odda.display AS dataAbsentReason_display FROM observation AS o LEFT JOIN core__observation_dn_category AS odcat ON o.id = odcat.id LEFT JOIN core__observation_dn_code AS odc ON o.id = odc.id @@ -375,7 +375,7 @@ SELECT valueCodeableConcept_display, valueQuantity_value, valueQuantity_comparator, - valueQuantity_unit,valueQuantity_code_system AS valueQuantity_system, -- old alias + valueQuantity_unit, valueQuantity_code_system, valueQuantity_code, valueString, diff --git a/cumulus_library/studies/core/reference_sql/builder_patient.sql b/cumulus_library/studies/core/reference_sql/builder_patient.sql index 968144e2..4e8bcbc8 100644 --- a/cumulus_library/studies/core/reference_sql/builder_patient.sql +++ b/cumulus_library/studies/core/reference_sql/builder_patient.sql @@ -43,23 +43,6 @@ CREATE TABLE core__patient_ext_race AS ( AND ext_child.ext.valuecoding.display != '' ), - system_text AS ( - SELECT DISTINCT - s.id AS id, - '2' AS priority, - 'text' AS system, -- noqa: RF04 - ext_child.ext.valuecoding.code AS race_code, - ext_child.ext.valuecoding.display AS race_display - FROM - patient AS s, - UNNEST(s.extension) AS ext_parent (ext), - UNNEST(ext_parent.ext.extension) AS ext_child (ext) - WHERE - ext_parent.ext.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race' - AND ext_child.ext.url = 'text' - AND ext_child.ext.valuecoding.display != '' - ), - union_table AS ( SELECT id, @@ -76,14 +59,6 @@ CREATE TABLE core__patient_ext_race AS ( race_code, race_display FROM system_detailed - UNION - SELECT - id, - priority, - system, - race_code, - race_display - FROM system_text ORDER BY id, priority ) @@ -118,7 +93,7 @@ CREATE TABLE core__patient_ext_race AS ( ) AS race_display, ROW_NUMBER() OVER ( - PARTITION BY id, system + PARTITION BY id ORDER BY priority ASC ) AS available_priority FROM union_table @@ -166,23 +141,6 @@ CREATE TABLE core__patient_ext_ethnicity AS ( AND ext_child.ext.valuecoding.display != '' ), - system_text AS ( - SELECT DISTINCT - s.id AS id, - '2' AS priority, - 'text' AS system, -- noqa: RF04 - ext_child.ext.valuecoding.code AS ethnicity_code, - ext_child.ext.valuecoding.display AS ethnicity_display - FROM - patient AS s, - UNNEST(s.extension) AS ext_parent (ext), - UNNEST(ext_parent.ext.extension) AS ext_child (ext) - WHERE - ext_parent.ext.url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity' - AND ext_child.ext.url = 'text' - AND ext_child.ext.valuecoding.display != '' - ), - union_table AS ( SELECT id, @@ -199,14 +157,6 @@ CREATE TABLE core__patient_ext_ethnicity AS ( ethnicity_code, ethnicity_display FROM system_detailed - UNION - SELECT - id, - priority, - system, - ethnicity_code, - ethnicity_display - FROM system_text ORDER BY id, priority ) @@ -241,7 +191,7 @@ CREATE TABLE core__patient_ext_ethnicity AS ( ) AS ethnicity_display, ROW_NUMBER() OVER ( - PARTITION BY id, system + PARTITION BY id ORDER BY priority ASC ) AS available_priority FROM union_table diff --git a/cumulus_library/template_sql/extension_denormalize.sql.jinja b/cumulus_library/template_sql/extension_denormalize.sql.jinja index 6ed53ec6..f664fd16 100644 --- a/cumulus_library/template_sql/extension_denormalize.sql.jinja +++ b/cumulus_library/template_sql/extension_denormalize.sql.jinja @@ -72,7 +72,7 @@ CREATE TABLE {{ target_table }} AS ( {%- endif %} ROW_NUMBER() OVER ( - PARTITION BY id, system + PARTITION BY id ORDER BY priority ASC ) AS available_priority FROM union_table diff --git a/cumulus_library/template_sql/sql_utils.py b/cumulus_library/template_sql/sql_utils.py index 7493f8a1..5902d07a 100644 --- a/cumulus_library/template_sql/sql_utils.py +++ b/cumulus_library/template_sql/sql_utils.py @@ -203,10 +203,13 @@ def is_field_populated( parser: databases.DatabaseParser, source_table: str, hierarchy: list[tuple], - expected: list | None = None, + expected: list | dict | None = None, ) -> bool: """Traverses a complex field and determines if it exists and has data + Non-core studies that rely on the core tables shouldn't need this method. + This is just to examine the weird and wonderful world of the raw FHIR tables. + :keyword schema: The schema/database name :keyword cursor: a PEP-249 compliant database cursor :keyword source_table: The table to query against @@ -217,7 +220,7 @@ def is_field_populated( If none, we assume it is a CodeableConcept. :returns: a boolean indicating if valid data is present. """ - if not _check_schema_if_exists( + if not is_field_present( schema=schema, cursor=cursor, parser=parser, @@ -256,14 +259,14 @@ def is_field_populated( return True -def _check_schema_if_exists( +def is_field_present( *, schema: str, cursor: databases.DatabaseCursor, parser: databases.DatabaseParser, source_table: str, source_col: str, - expected: str | None = None, + expected: list | dict | None = None, ) -> bool: """Validation check for a column existing, and having the expected schema diff --git a/docs/first-time-setup.md b/docs/first-time-setup.md index c6c0f311..ae893bcb 100644 --- a/docs/first-time-setup.md +++ b/docs/first-time-setup.md @@ -8,15 +8,20 @@ nav_order: 1 # First Time Setup -## Installation +## Prerequisites + +1. Python 3.10 or later. +2. Access to an AWS cloud services account. +See the [AWS setup guide](./aws-setup.md) for more information on this. +3. An Athena database populated by +[Cumulus ETL](https://docs.smarthealthit.org/cumulus/etl/) +version 1.0 or later -As a prerequisite, you'll need a copy of python 3.10 or later installed on -your system, and you'll need access to an AWS cloud services account. +## Installation -You can install directly from pypi by running `pip install cumulus-library`. +You can install directly from pypi by running: -You will also need to make sure your machine is configured correctly to talk to AWS -services. See the [AWS setup guide](./aws-setup.md) for more information on this. +`pip install cumulus-library` ## Command line usage diff --git a/tests/core/test_core.py b/tests/core/test_core.py index dc9035c3..8a2beeae 100644 --- a/tests/core/test_core.py +++ b/tests/core/test_core.py @@ -169,9 +169,6 @@ def test_core_medication_query(medication_datasources, contains, omits): assert item not in query -# Patient schemas aren't fully pre-examined yet (we currently assume extensions exist). -# So we expect this to fail at the moment. -@pytest.mark.xfail def test_core_empty_database(tmp_path): """Verify that we can still generate core tables with no data filled in""" testbed = testbed_utils.LocalTestbed(tmp_path, with_patient=False) @@ -193,23 +190,6 @@ def test_core_tiny_database(tmp_path): assert {e[0] for e in encounters} == {"EncA"} -def test_core_multiple_patient_addresses(tmp_path): - """Verify that a patient with multiple addresses resolves to a single entry""" - testbed = testbed_utils.LocalTestbed(tmp_path, with_patient=False) - testbed.add_patient("None") - testbed.add_patient( - "Multi", - address=[ - {"city": "Boston"}, # null postal code - should not be picked up - {"postalCode": "12345"}, - {"postalCode": "00000"}, - ], - ) - con = testbed.build() - patients = con.sql("SELECT id, postalCode_3 FROM core__patient").fetchall() - assert {("None", "cumulus__none"), ("Multi", "123")} == set(patients) - - def test_core_multiple_doc_encounters(tmp_path): """Verify that a DocRef with multiple encounters resolves to multiple entries""" testbed = testbed_utils.LocalTestbed(tmp_path) diff --git a/tests/core/test_core_patient.py b/tests/core/test_core_patient.py new file mode 100644 index 00000000..31bc15e5 --- /dev/null +++ b/tests/core/test_core_patient.py @@ -0,0 +1,170 @@ +"""Tests for core__patient""" + +import pytest + +from tests import testbed_utils + + +@pytest.mark.parametrize( + "addresses,expected", + [ + (None, "cumulus__none"), # no address + ([{"city": "Boston"}], "cumulus__none"), # partial, but useless address + ( # multiple addresses + [ + {"city": "Boston"}, # null postal code - should not be picked up + {"postalCode": "12345"}, + {"postalCode": "00000"}, + ], + "123", + ), + ], +) +def test_core_patient_addresses(tmp_path, addresses, expected): + """Verify that addresses are parsed out""" + testbed = testbed_utils.LocalTestbed(tmp_path, with_patient=False) + testbed.add_patient("A", address=addresses) + con = testbed.build() + codes = con.sql("SELECT postalCode_3 FROM core__patient").fetchall() + assert [(expected,)] == codes + + +@pytest.mark.parametrize( + "extensions,expected_ethnicity,expected_race", + [ + (None, "unknown", "unknown"), # no extension + ( # basic ombCategory + [ + { + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity", + "extension": [ + { + "url": "detailed", # ignored in favor of ombCategory + "valueCoding": {"display": "EthDetailed"}, + }, + { + "url": "ombCategory", + "valueCoding": {"display": "EthA"}, + }, + ], + }, + { + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race", + "extension": [ + { + "url": "ombCategory", + "valueCoding": {"display": "RaceA"}, + }, + { + "url": "detailed", # ignored in favor of ombCategory + "valueCoding": {"display": "RaceDetailed"}, + }, + ], + }, + ], + "etha", + "racea", + ), + ( # will use detailed if we must + [ + { + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity", + "extension": [ + { + "url": "detailed", + "valueCoding": {"display": "EthDetailed"}, + } + ], + }, + { + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race", + "extension": [ + { + "url": "detailed", + "valueCoding": {"display": "RaceDetailed"}, + } + ], + }, + ], + "ethdetailed", + "racedetailed", + ), + ( # will ignore entries without a display + [ + { + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity", + "extension": [ + { + "url": "ombCategory", + "valueCoding": { + "display": "" # empty string (instead of null) + }, + }, + { + "url": "ombCategory", + "valueCoding": {"display": "EthB"}, + }, + ], + }, + { + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race", + "extension": [ + { + "url": "ombCategory", + "valueCoding": {"code": "just-a-code"}, + }, + { + "url": "detailed", + "valueCoding": {"display": "RaceDetailed"}, + }, + ], + }, + ], + "ethb", + "racedetailed", + ), + ( # multiples get joined + [ + { + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity", + "extension": [ + { + "url": "detailed", + "valueCoding": {"display": "EthB"}, + }, + { + "url": "detailed", + "valueCoding": {"display": "EthA"}, + }, + ], + }, + { + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race", + "extension": [ + { + "url": "ombCategory", + "valueCoding": {"display": "RaceA"}, + }, + { + "url": "ombCategory", + "valueCoding": {"display": "RaceB"}, + }, + ], + }, + ], + "etha; ethb", + "racea; raceb", + ), + ], +) +def test_core_patient_extensions( + tmp_path, extensions, expected_ethnicity, expected_race +): + """Verify that we grab race & ethnicity correctly""" + testbed = testbed_utils.LocalTestbed(tmp_path, with_patient=False) + testbed.add_patient("A", extension=extensions) + con = testbed.build() + displays = con.sql( + "SELECT ethnicity_display, race_display FROM core__patient" + ).fetchall() + assert [(expected_ethnicity, expected_race)] == displays diff --git a/tests/regression/reference/core__count_medicationrequest_month.csv b/tests/regression/reference/core__count_medicationrequest_month.csv index f834bb44..193bca43 100644 --- a/tests/regression/reference/core__count_medicationrequest_month.csv +++ b/tests/regression/reference/core__count_medicationrequest_month.csv @@ -1,8 +1,8 @@ cnt,status,intent,authoredon_month,medication_display -930,,,, -930,,order,, -896,stopped,,, -896,stopped,order,, +931,,,, +931,,order,, +898,stopped,,, +898,stopped,order,, 665,active,,, 665,active,order,, 242,,,,lisinopril 10 MG Oral Tablet @@ -35,10 +35,10 @@ cnt,status,intent,authoredon_month,medication_display 146,,order,,Ibuprofen 200 MG Oral Tablet 146,stopped,,,Ibuprofen 200 MG Oral Tablet 146,stopped,order,,Ibuprofen 200 MG Oral Tablet -141,,,2014-02-01, -141,,order,2014-02-01, -140,stopped,,2014-02-01, -140,stopped,order,2014-02-01, +142,,,2014-02-01, +142,,order,2014-02-01, +141,stopped,,2014-02-01, +141,stopped,order,2014-02-01, 119,,,,Acetaminophen 160 MG Chewable Tablet 119,,order,,Acetaminophen 160 MG Chewable Tablet 118,stopped,,,Acetaminophen 160 MG Chewable Tablet @@ -71,14 +71,14 @@ cnt,status,intent,authoredon_month,medication_display 97,,order,2021-03-01, 96,,,2019-03-01, 96,,order,2019-03-01, +96,stopped,,2021-03-01, 96,stopped,,2014-05-01, +96,stopped,order,2021-03-01, 96,stopped,order,2014-05-01, 95,stopped,,2019-03-01, 95,stopped,order,2019-03-01, 94,,,,Amoxicillin 500 MG Oral Tablet 94,,order,,Amoxicillin 500 MG Oral Tablet -94,stopped,,2021-03-01, -94,stopped,order,2021-03-01, 93,,,2014-04-01, 93,,order,2014-04-01, 92,,,2017-03-01, @@ -92,13 +92,13 @@ cnt,status,intent,authoredon_month,medication_display 88,,,2014-03-01, 88,,order,2014-03-01, 87,,,2022-03-01, +87,,,2014-01-01, 87,,order,2022-03-01, +87,,order,2014-01-01, 86,,,2022-04-01, -86,,,2014-01-01, 86,,order,2022-04-01, -86,,order,2014-01-01, -85,stopped,,2014-01-01, -85,stopped,order,2014-01-01, +86,stopped,,2014-01-01, +86,stopped,order,2014-01-01, 84,,,2021-09-01, 84,,order,2021-09-01, 84,stopped,,2014-04-01, @@ -118,10 +118,12 @@ cnt,status,intent,authoredon_month,medication_display 81,,order,2021-06-01, 81,,order,2021-02-01, 80,,,2021-08-01, +80,,,2020-06-01, 80,,,2017-01-01, 80,,,2016-02-01, 80,,,2015-01-01, 80,,order,2021-08-01, +80,,order,2020-06-01, 80,,order,2017-01-01, 80,,order,2016-02-01, 80,,order,2015-01-01, @@ -136,15 +138,19 @@ cnt,status,intent,authoredon_month,medication_display 80,stopped,order,2019-08-01, 80,stopped,order,2016-02-01, 79,,,2022-06-01, -79,,,2020-06-01, +79,,,2021-01-01, 79,,,2018-05-01, 79,,,2016-01-01, 79,,order,2022-06-01, -79,,order,2020-06-01, +79,,order,2021-01-01, 79,,order,2018-05-01, 79,,order,2016-01-01, +79,stopped,,2021-01-01, +79,stopped,,2020-06-01, 79,stopped,,2016-01-01, 79,stopped,,2015-01-01, +79,stopped,order,2021-01-01, +79,stopped,order,2020-06-01, 79,stopped,order,2016-01-01, 79,stopped,order,2015-01-01, 78,,,2022-07-01, @@ -171,34 +177,28 @@ cnt,status,intent,authoredon_month,medication_display 77,,order,2020-02-01, 77,stopped,,2021-12-01, 77,stopped,,2020-08-01, -77,stopped,,2020-06-01, 77,stopped,,2019-05-01, 77,stopped,,2019-01-01, 77,stopped,,2018-08-01, 77,stopped,,2018-05-01, 77,stopped,order,2021-12-01, 77,stopped,order,2020-08-01, -77,stopped,order,2020-06-01, 77,stopped,order,2019-05-01, 77,stopped,order,2019-01-01, 77,stopped,order,2018-08-01, 77,stopped,order,2018-05-01, 76,,,,Acetaminophen 300 MG / Hydrocodone Bitartrate 5 MG Oral Tablet 76,,,2021-07-01, -76,,,2021-01-01, 76,,,2017-05-01, 76,,,2015-04-01, 76,,order,,Acetaminophen 300 MG / Hydrocodone Bitartrate 5 MG Oral Tablet 76,,order,2021-07-01, -76,,order,2021-01-01, 76,,order,2017-05-01, 76,,order,2015-04-01, -76,stopped,,2021-01-01, 76,stopped,,2020-02-01, 76,stopped,,2017-07-01, 76,stopped,,2017-05-01, 76,stopped,,2015-04-01, -76,stopped,order,2021-01-01, 76,stopped,order,2020-02-01, 76,stopped,order,2017-07-01, 76,stopped,order,2017-05-01, @@ -207,6 +207,7 @@ cnt,status,intent,authoredon_month,medication_display 76,active,order,,Acetaminophen 300 MG / Hydrocodone Bitartrate 5 MG Oral Tablet 75,,,2021-10-01, 75,,,2021-05-01, +75,,,2020-10-01, 75,,,2015-02-01, 75,,,2014-12-01, 75,,,2014-09-01, @@ -214,6 +215,7 @@ cnt,status,intent,authoredon_month,medication_display 75,,,2014-06-01, 75,,order,2021-10-01, 75,,order,2021-05-01, +75,,order,2020-10-01, 75,,order,2015-02-01, 75,,order,2014-12-01, 75,,order,2014-09-01, @@ -227,20 +229,20 @@ cnt,status,intent,authoredon_month,medication_display 75,stopped,order,2015-02-01, 75,stopped,order,2014-12-01, 75,stopped,order,2014-09-01, -74,,,2020-10-01, 74,,,2020-05-01, 74,,,2018-06-01, -74,,order,2020-10-01, 74,,order,2020-05-01, 74,,order,2018-06-01, 74,stopped,,2022-03-01, 74,stopped,,2021-10-01, 74,stopped,,2021-07-01, +74,stopped,,2020-10-01, 74,stopped,,2020-01-01, 74,stopped,,2018-06-01, 74,stopped,order,2022-03-01, 74,stopped,order,2021-10-01, 74,stopped,order,2021-07-01, +74,stopped,order,2020-10-01, 74,stopped,order,2020-01-01, 74,stopped,order,2018-06-01, 73,,,2022-12-01, @@ -249,57 +251,55 @@ cnt,status,intent,authoredon_month,medication_display 73,,,2022-05-01, 73,,,2018-11-01, 73,,,2018-01-01, +73,,,2016-09-01, 73,,order,2022-12-01, 73,,order,2022-10-01, 73,,order,2022-08-01, 73,,order,2022-05-01, 73,,order,2018-11-01, 73,,order,2018-01-01, -73,stopped,,2020-10-01, +73,,order,2016-09-01, 73,stopped,,2020-05-01, 73,stopped,,2018-11-01, 73,stopped,,2018-01-01, +73,stopped,,2016-09-01, 73,stopped,,2014-07-01, -73,stopped,order,2020-10-01, 73,stopped,order,2020-05-01, 73,stopped,order,2018-11-01, 73,stopped,order,2018-01-01, +73,stopped,order,2016-09-01, 73,stopped,order,2014-07-01, 72,,,2022-09-01, 72,,,2021-04-01, +72,,,2019-10-01, 72,,,2017-09-01, -72,,,2016-09-01, 72,,,2016-08-01, 72,,,2016-03-01, 72,,order,2022-09-01, 72,,order,2021-04-01, +72,,order,2019-10-01, 72,,order,2017-09-01, -72,,order,2016-09-01, 72,,order,2016-08-01, 72,,order,2016-03-01, 72,stopped,,2021-04-01, +72,stopped,,2019-10-01, 72,stopped,,2017-09-01, -72,stopped,,2016-09-01, +72,stopped,,2016-08-01, 72,stopped,order,2021-04-01, +72,stopped,order,2019-10-01, 72,stopped,order,2017-09-01, -72,stopped,order,2016-09-01, +72,stopped,order,2016-08-01, 71,,,2023-02-01, 71,,,2020-09-01, -71,,,2019-10-01, 71,,,2017-10-01, 71,,,2017-06-01, 71,,order,2023-02-01, 71,,order,2020-09-01, -71,,order,2019-10-01, 71,,order,2017-10-01, 71,,order,2017-06-01, 71,stopped,,2020-09-01, -71,stopped,,2019-10-01, -71,stopped,,2016-08-01, 71,stopped,,2014-06-01, 71,stopped,order,2020-09-01, -71,stopped,order,2019-10-01, -71,stopped,order,2016-08-01, 71,stopped,order,2014-06-01, 70,stopped,,2017-10-01, 70,stopped,,2016-03-01, @@ -321,11 +321,13 @@ cnt,status,intent,authoredon_month,medication_display 69,stopped,order,2015-11-01, 68,,,2023-01-01, 68,,,2022-02-01, +68,,,2019-11-01, 68,,,2018-09-01, 68,,,2016-12-01, 68,,,2015-06-01, 68,,order,2023-01-01, 68,,order,2022-02-01, +68,,order,2019-11-01, 68,,order,2018-09-01, 68,,order,2016-12-01, 68,,order,2015-06-01, @@ -337,52 +339,62 @@ cnt,status,intent,authoredon_month,medication_display 68,stopped,order,2017-06-01, 68,stopped,order,2016-12-01, 68,stopped,order,2015-06-01, -67,,,2019-11-01, 67,,,2019-06-01, 67,,,2017-12-01, 67,,,2017-08-01, 67,,,2016-07-01, 67,,,2015-03-01, -67,,order,2019-11-01, 67,,order,2019-06-01, 67,,order,2017-12-01, 67,,order,2017-08-01, 67,,order,2016-07-01, 67,,order,2015-03-01, +67,stopped,,2019-11-01, 67,stopped,,2018-09-01, 67,stopped,,2017-12-01, 67,stopped,,2017-08-01, 67,stopped,,2016-07-01, +67,stopped,order,2019-11-01, 67,stopped,order,2018-09-01, 67,stopped,order,2017-12-01, 67,stopped,order,2017-08-01, 67,stopped,order,2016-07-01, +66,,,2018-02-01, 66,,,2016-05-01, 66,,,2014-08-01, +66,,order,2018-02-01, 66,,order,2016-05-01, 66,,order,2014-08-01, -66,stopped,,2019-11-01, 66,stopped,,2019-06-01, 66,stopped,,2015-03-01, -66,stopped,order,2019-11-01, 66,stopped,order,2019-06-01, 66,stopped,order,2015-03-01, +65,,,2020-12-01, +65,,,2020-11-01, 65,,,2018-04-01, -65,,,2018-02-01, 65,,,2017-11-01, 65,,,2016-06-01, 65,,,2015-05-01, 65,,,2013-01-01, +65,,order,2020-12-01, +65,,order,2020-11-01, 65,,order,2018-04-01, -65,,order,2018-02-01, 65,,order,2017-11-01, 65,,order,2016-06-01, 65,,order,2015-05-01, 65,,order,2013-01-01, +65,stopped,,2020-12-01, 65,stopped,,2018-04-01, +65,stopped,,2018-02-01, +65,stopped,,2017-11-01, +65,stopped,,2016-06-01, 65,stopped,,2015-05-01, 65,stopped,,2013-01-01, +65,stopped,order,2020-12-01, 65,stopped,order,2018-04-01, +65,stopped,order,2018-02-01, +65,stopped,order,2017-11-01, +65,stopped,order,2016-06-01, 65,stopped,order,2015-05-01, 65,stopped,order,2013-01-01, 64,,,2021-11-01, @@ -390,6 +402,7 @@ cnt,status,intent,authoredon_month,medication_display 64,,,2019-07-01, 64,,,2019-04-01, 64,,,2017-02-01, +64,,,2015-12-01, 64,,,2015-07-01, 64,,,2012-01-01, 64,,order,2021-11-01, @@ -397,56 +410,47 @@ cnt,status,intent,authoredon_month,medication_display 64,,order,2019-07-01, 64,,order,2019-04-01, 64,,order,2017-02-01, +64,,order,2015-12-01, 64,,order,2015-07-01, 64,,order,2012-01-01, +64,stopped,,2020-11-01, 64,stopped,,2019-04-01, -64,stopped,,2018-02-01, -64,stopped,,2017-11-01, 64,stopped,,2017-02-01, -64,stopped,,2016-06-01, +64,stopped,,2016-05-01, +64,stopped,,2015-07-01, +64,stopped,order,2020-11-01, 64,stopped,order,2019-04-01, -64,stopped,order,2018-02-01, -64,stopped,order,2017-11-01, 64,stopped,order,2017-02-01, -64,stopped,order,2016-06-01, -63,,,2020-11-01, +64,stopped,order,2016-05-01, +64,stopped,order,2015-07-01, 63,,,2020-04-01, -63,,,2015-12-01, +63,,,2015-10-01, 63,,,2015-09-01, 63,,,2009-12-01, -63,,order,2020-11-01, 63,,order,2020-04-01, -63,,order,2015-12-01, +63,,order,2015-10-01, 63,,order,2015-09-01, 63,,order,2009-12-01, 63,stopped,,2021-11-01, 63,stopped,,2020-04-01, 63,stopped,,2019-07-01, -63,stopped,,2016-05-01, -63,stopped,,2015-07-01, +63,stopped,,2015-12-01, +63,stopped,,2015-09-01, 63,stopped,,2009-12-01, 63,stopped,order,2021-11-01, 63,stopped,order,2020-04-01, 63,stopped,order,2019-07-01, -63,stopped,order,2016-05-01, -63,stopped,order,2015-07-01, +63,stopped,order,2015-12-01, +63,stopped,order,2015-09-01, 63,stopped,order,2009-12-01, -62,,,2020-12-01, -62,,,2015-10-01, 62,,,2013-10-01, -62,,order,2020-12-01, -62,,order,2015-10-01, 62,,order,2013-10-01, -62,stopped,,2020-11-01, 62,stopped,,2020-07-01, -62,stopped,,2015-12-01, -62,stopped,,2015-09-01, +62,stopped,,2015-10-01, 62,stopped,,2014-08-01, 62,stopped,,2012-01-01, -62,stopped,order,2020-11-01, 62,stopped,order,2020-07-01, -62,stopped,order,2015-12-01, -62,stopped,order,2015-09-01, +62,stopped,order,2015-10-01, 62,stopped,order,2014-08-01, 62,stopped,order,2012-01-01, 61,,,2016-10-01, @@ -457,11 +461,7 @@ cnt,status,intent,authoredon_month,medication_display 61,,order,2015-08-01, 61,,order,2014-11-01, 61,,order,2007-12-01, -61,stopped,,2020-12-01, -61,stopped,,2015-10-01, 61,stopped,,2007-12-01, -61,stopped,order,2020-12-01, -61,stopped,order,2015-10-01, 61,stopped,order,2007-12-01, 60,,,2018-12-01, 60,,,2016-04-01, @@ -472,14 +472,14 @@ cnt,status,intent,authoredon_month,medication_display 60,stopped,,2018-12-01, 60,stopped,,2016-04-01, 60,stopped,,2015-08-01, +60,stopped,,2014-11-01, 60,stopped,order,2018-12-01, 60,stopped,order,2016-04-01, 60,stopped,order,2015-08-01, +60,stopped,order,2014-11-01, 59,stopped,,2016-10-01, -59,stopped,,2014-11-01, 59,stopped,,2013-10-01, 59,stopped,order,2016-10-01, -59,stopped,order,2014-11-01, 59,stopped,order,2013-10-01, 58,,,2018-07-01, 58,,,2016-11-01, @@ -535,31 +535,33 @@ cnt,status,intent,authoredon_month,medication_display 53,stopped,order,2011-12-01, 52,,,2017-04-01, 52,,,2013-07-01, +52,,,2013-04-01, 52,,,2010-01-01, 52,,order,2017-04-01, 52,,order,2013-07-01, +52,,order,2013-04-01, 52,,order,2010-01-01, 52,stopped,,,24 HR tacrolimus 1 MG Extended Release Oral Tablet 52,stopped,,2013-07-01, +52,stopped,,2013-05-01, 52,stopped,,2010-01-01, 52,stopped,order,,24 HR tacrolimus 1 MG Extended Release Oral Tablet 52,stopped,order,2013-07-01, +52,stopped,order,2013-05-01, 52,stopped,order,2010-01-01, 51,,,2013-06-01, -51,,,2013-04-01, 51,,,2012-09-01, 51,,,2010-03-01, 51,,,2009-04-01, 51,,order,2013-06-01, -51,,order,2013-04-01, 51,,order,2012-09-01, 51,,order,2010-03-01, 51,,order,2009-04-01, 51,stopped,,2017-04-01, -51,stopped,,2013-05-01, +51,stopped,,2013-04-01, 51,stopped,,2010-12-01, 51,stopped,order,2017-04-01, -51,stopped,order,2013-05-01, +51,stopped,order,2013-04-01, 51,stopped,order,2010-12-01, 50,,,2012-05-01, 50,,,2011-05-01, @@ -571,12 +573,10 @@ cnt,status,intent,authoredon_month,medication_display 50,,order,2009-03-01, 50,stopped,,2022-07-01, 50,stopped,,2013-06-01, -50,stopped,,2013-04-01, 50,stopped,,2010-03-01, 50,stopped,,2009-04-01, 50,stopped,order,2022-07-01, 50,stopped,order,2013-06-01, -50,stopped,order,2013-04-01, 50,stopped,order,2010-03-01, 50,stopped,order,2009-04-01, 49,,,2011-01-01, @@ -588,22 +588,28 @@ cnt,status,intent,authoredon_month,medication_display 49,stopped,order,2022-06-01, 49,stopped,order,2010-08-01, 48,,,,Aspirin 81 MG Oral Tablet +48,,,2009-01-01, 48,,,2004-11-01, 48,,,2003-11-01, 48,,order,,Aspirin 81 MG Oral Tablet +48,,order,2009-01-01, 48,,order,2004-11-01, 48,,order,2003-11-01, 48,stopped,,,Aspirin 81 MG Oral Tablet 48,stopped,,2012-09-01, 48,stopped,,2012-05-01, +48,stopped,,2011-05-01, 48,stopped,,2011-01-01, +48,stopped,,2009-01-01, 48,stopped,,2008-09-01, 48,stopped,,2004-11-01, 48,stopped,,2003-11-01, 48,stopped,order,,Aspirin 81 MG Oral Tablet 48,stopped,order,2012-09-01, 48,stopped,order,2012-05-01, +48,stopped,order,2011-05-01, 48,stopped,order,2011-01-01, +48,stopped,order,2009-01-01, 48,stopped,order,2008-09-01, 48,stopped,order,2004-11-01, 48,stopped,order,2003-11-01, @@ -613,23 +619,17 @@ cnt,status,intent,authoredon_month,medication_display 47,,,2012-10-01, 47,,,2010-10-01, 47,,,2010-05-01, -47,,,2009-01-01, 47,,,2002-11-01, 47,,order,2013-11-01, 47,,order,2012-10-01, 47,,order,2010-10-01, 47,,order,2010-05-01, -47,,order,2009-01-01, 47,,order,2002-11-01, -47,stopped,,2011-05-01, 47,stopped,,2010-10-01, 47,stopped,,2009-03-01, -47,stopped,,2009-01-01, 47,stopped,,2002-11-01, -47,stopped,order,2011-05-01, 47,stopped,order,2010-10-01, 47,stopped,order,2009-03-01, -47,stopped,order,2009-01-01, 47,stopped,order,2002-11-01, 46,,,,Ibuprofen 400 MG Oral Tablet [Ibu] 46,,,2011-11-01, @@ -646,11 +646,13 @@ cnt,status,intent,authoredon_month,medication_display 46,,order,2009-05-01, 46,,order,2006-12-01, 46,stopped,,,Ibuprofen 400 MG Oral Tablet [Ibu] +46,stopped,,2022-04-01, 46,stopped,,2013-11-01, 46,stopped,,2012-10-01, 46,stopped,,2011-11-01, 46,stopped,,2011-09-01, 46,stopped,order,,Ibuprofen 400 MG Oral Tablet [Ibu] +46,stopped,order,2022-04-01, 46,stopped,order,2013-11-01, 46,stopped,order,2012-10-01, 46,stopped,order,2011-11-01, @@ -672,7 +674,6 @@ cnt,status,intent,authoredon_month,medication_display 45,,order,2005-11-01, 45,,order,2000-11-01, 45,stopped,,2022-05-01, -45,stopped,,2022-04-01, 45,stopped,,2012-11-01, 45,stopped,,2011-08-01, 45,stopped,,2010-05-01, @@ -681,7 +682,6 @@ cnt,status,intent,authoredon_month,medication_display 45,stopped,,2005-11-01, 45,stopped,,2000-11-01, 45,stopped,order,2022-05-01, -45,stopped,order,2022-04-01, 45,stopped,order,2012-11-01, 45,stopped,order,2011-08-01, 45,stopped,order,2010-05-01, @@ -986,6 +986,7 @@ cnt,status,intent,authoredon_month,medication_display 37,stopped,,2018-03-01,lisinopril 10 MG Oral Tablet 37,stopped,,2010-02-01, 37,stopped,,2009-11-01, +37,stopped,,2006-06-01, 37,stopped,,2001-03-01, 37,stopped,,2000-06-01, 37,stopped,,2000-03-01, @@ -997,6 +998,7 @@ cnt,status,intent,authoredon_month,medication_display 37,stopped,order,2018-03-01,lisinopril 10 MG Oral Tablet 37,stopped,order,2010-02-01, 37,stopped,order,2009-11-01, +37,stopped,order,2006-06-01, 37,stopped,order,2001-03-01, 37,stopped,order,2000-06-01, 37,stopped,order,2000-03-01, @@ -1037,7 +1039,6 @@ cnt,status,intent,authoredon_month,medication_display 36,stopped,,2014-05-01,lisinopril 10 MG Oral Tablet 36,stopped,,2014-01-01,lisinopril 10 MG Oral Tablet 36,stopped,,2010-06-01, -36,stopped,,2006-06-01, 36,stopped,,2002-12-01, 36,stopped,,2002-02-01, 36,stopped,order,2022-12-01, @@ -1046,7 +1047,6 @@ cnt,status,intent,authoredon_month,medication_display 36,stopped,order,2014-05-01,lisinopril 10 MG Oral Tablet 36,stopped,order,2014-01-01,lisinopril 10 MG Oral Tablet 36,stopped,order,2010-06-01, -36,stopped,order,2006-06-01, 36,stopped,order,2002-12-01, 36,stopped,order,2002-02-01, 36,active,,,Fexofenadine hydrochloride 30 MG Oral Tablet @@ -1328,6 +1328,7 @@ cnt,status,intent,authoredon_month,medication_display 33,stopped,,2003-12-01, 33,stopped,,2003-05-01, 33,stopped,,2002-04-01, +33,stopped,,2001-12-01, 33,stopped,,2001-10-01, 33,stopped,,2001-04-01, 33,stopped,,2000-08-01, @@ -1359,6 +1360,7 @@ cnt,status,intent,authoredon_month,medication_display 33,stopped,order,2003-12-01, 33,stopped,order,2003-05-01, 33,stopped,order,2002-04-01, +33,stopped,order,2001-12-01, 33,stopped,order,2001-10-01, 33,stopped,order,2001-04-01, 33,stopped,order,2000-08-01, @@ -1438,7 +1440,6 @@ cnt,status,intent,authoredon_month,medication_display 32,stopped,,2005-03-01, 32,stopped,,2005-01-01, 32,stopped,,2004-03-01, -32,stopped,,2001-12-01, 32,stopped,,2000-09-01, 32,stopped,,2000-02-01, 32,stopped,,1999-06-01, @@ -1465,7 +1466,6 @@ cnt,status,intent,authoredon_month,medication_display 32,stopped,order,2005-03-01, 32,stopped,order,2005-01-01, 32,stopped,order,2004-03-01, -32,stopped,order,2001-12-01, 32,stopped,order,2000-09-01, 32,stopped,order,2000-02-01, 32,stopped,order,1999-06-01, @@ -3411,6 +3411,7 @@ cnt,status,intent,authoredon_month,medication_display 22,stopped,order,1987-01-01, 22,stopped,order,1986-08-01, 22,stopped,order,1986-06-01, +21,,,,aspirin 325 MG Oral Tablet 21,,,2020-07-01,lisinopril 10 MG Oral Tablet 21,,,2018-12-01,Hydrochlorothiazide 25 MG Oral Tablet 21,,,2018-05-01,Hydrochlorothiazide 25 MG Oral Tablet @@ -3476,6 +3477,7 @@ cnt,status,intent,authoredon_month,medication_display 21,,,1984-11-01, 21,,,1983-05-01, 21,,,1980-11-01, +21,,order,,aspirin 325 MG Oral Tablet 21,,order,2020-07-01,lisinopril 10 MG Oral Tablet 21,,order,2018-12-01,Hydrochlorothiazide 25 MG Oral Tablet 21,,order,2018-05-01,Hydrochlorothiazide 25 MG Oral Tablet @@ -3541,6 +3543,7 @@ cnt,status,intent,authoredon_month,medication_display 21,,order,1984-11-01, 21,,order,1983-05-01, 21,,order,1980-11-01, +21,stopped,,,aspirin 325 MG Oral Tablet 21,stopped,,,albuterol 0.83 MG/ML Inhalation Solution 21,stopped,,2022-06-01,lisinopril 10 MG Oral Tablet 21,stopped,,2020-07-01,lisinopril 10 MG Oral Tablet @@ -3602,6 +3605,7 @@ cnt,status,intent,authoredon_month,medication_display 21,stopped,,1986-04-01, 21,stopped,,1985-08-01, 21,stopped,,1980-11-01, +21,stopped,order,,aspirin 325 MG Oral Tablet 21,stopped,order,,albuterol 0.83 MG/ML Inhalation Solution 21,stopped,order,2022-06-01,lisinopril 10 MG Oral Tablet 21,stopped,order,2020-07-01,lisinopril 10 MG Oral Tablet @@ -5137,6 +5141,7 @@ cnt,status,intent,authoredon_month,medication_display 16,stopped,,1986-09-01,lisinopril 10 MG Oral Tablet 16,stopped,,1986-02-01, 16,stopped,,1985-07-01, +16,stopped,,1984-06-01, 16,stopped,,1983-03-01, 16,stopped,,1982-05-01, 16,stopped,,1982-04-01, @@ -5209,6 +5214,7 @@ cnt,status,intent,authoredon_month,medication_display 16,stopped,order,1986-09-01,lisinopril 10 MG Oral Tablet 16,stopped,order,1986-02-01, 16,stopped,order,1985-07-01, +16,stopped,order,1984-06-01, 16,stopped,order,1983-03-01, 16,stopped,order,1982-05-01, 16,stopped,order,1982-04-01, @@ -5434,7 +5440,6 @@ cnt,status,intent,authoredon_month,medication_display 15,stopped,,1986-11-01, 15,stopped,,1985-04-01, 15,stopped,,1985-03-01, -15,stopped,,1984-06-01, 15,stopped,,1984-04-01, 15,stopped,,1983-10-01, 15,stopped,,1983-04-01, @@ -5511,7 +5516,6 @@ cnt,status,intent,authoredon_month,medication_display 15,stopped,order,1986-11-01, 15,stopped,order,1985-04-01, 15,stopped,order,1985-03-01, -15,stopped,order,1984-06-01, 15,stopped,order,1984-04-01, 15,stopped,order,1983-10-01, 15,stopped,order,1983-04-01, diff --git a/tests/regression/reference/core__count_medicationrequest_month.parquet b/tests/regression/reference/core__count_medicationrequest_month.parquet index 052118be..2f9d4fb2 100644 Binary files a/tests/regression/reference/core__count_medicationrequest_month.parquet and b/tests/regression/reference/core__count_medicationrequest_month.parquet differ diff --git a/tests/test_templates.py b/tests/test_templates.py index 2b61e240..146d09fd 100644 --- a/tests/test_templates.py +++ b/tests/test_templates.py @@ -362,7 +362,7 @@ def test_extension_denormalize_creation(): ) AS prefix_display, ROW_NUMBER() OVER ( - PARTITION BY id, system + PARTITION BY id ORDER BY priority ASC ) AS available_priority FROM union_table diff --git a/tests/testbed_utils.py b/tests/testbed_utils.py index f8c6ae80..f68f5692 100644 --- a/tests/testbed_utils.py +++ b/tests/testbed_utils.py @@ -163,23 +163,6 @@ def add_patient( "id": row_id, "birthDate": birth_date, "gender": gender, - # TODO: fix the core SQL to check for extensions in the schema - # before querying them. In the meantime, we can just ensure - # those fields exist, ready to be queried. - "extension": [ - { - "url": "", - "extension": [ - { - "url": "", - "valueCoding": { - "code": "", - "display": "", - }, - } - ], - } - ], **kwargs, }, )