From f694f72d946e708364049d6c40e1525518c2337d Mon Sep 17 00:00:00 2001 From: Matt Garber Date: Mon, 18 Mar 2024 14:05:21 -0400 Subject: [PATCH 1/8] Generic populated field detection --- cumulus_library/.sqlfluff | 1 + .../studies/core/builder_documentreference.py | 7 +- .../studies/core/builder_encounter.py | 4 +- .../studies/core/builder_medication.py | 41 +-- .../studies/core/builder_medicationrequest.py | 4 +- .../studies/core/builder_observation.py | 4 +- .../studies/core/builder_patient.py | 12 +- .../builder_documentreference.sql | 43 ++- .../studies/discovery/code_detection.py | 34 ++- .../template_sql/base_templates.py | 31 ++ .../template_sql/code_system_pairs.sql.jinja | 12 +- .../template_sql/coding_denormalize.sql.jinja | 74 +++++ cumulus_library/template_sql/sql_utils.py | 280 ++++++++---------- pyproject.toml | 6 + tests/conftest.py | 9 + tests/test_cli.py | 10 +- tests/test_core.py | 21 +- .../core/core__count_encounter_type_month.txt | 24 ++ .../core/core__documentreference.txt | 204 ++++++------- tests/test_data/core/core__encounter.txt | 34 +-- tests/test_data/core/core__encounter_type.txt | 100 +++---- .../discovery/discovery__code_sources.txt | 30 ++ .../core__count_encounter_enc_type_month.csv | 6 + .../core/core__count_encounter_type.csv | 8 + .../core/core__count_encounter_type_month.csv | 24 ++ tests/test_discovery.py | 64 ++++ tests/test_duckdb.py | 60 ++-- tests/test_template_sql_utils.py | 78 ++--- tests/test_templates.py | 36 ++- 29 files changed, 740 insertions(+), 521 deletions(-) create mode 100644 cumulus_library/template_sql/coding_denormalize.sql.jinja create mode 100644 tests/test_data/discovery/discovery__code_sources.txt create mode 100644 tests/test_discovery.py diff --git a/cumulus_library/.sqlfluff b/cumulus_library/.sqlfluff index b18c5420..100251c6 100644 --- a/cumulus_library/.sqlfluff +++ b/cumulus_library/.sqlfluff @@ -96,6 +96,7 @@ join_cols_by_table = join_id = subject_ref neg_source_table = neg_source_table output_table_name = 'created_table' +parent_field = 'parent' prefix = Test primary_ref = encounter_ref pos_source_table = pos_source_table diff --git a/cumulus_library/studies/core/builder_documentreference.py b/cumulus_library/studies/core/builder_documentreference.py index 9b7c93ab..44054adc 100644 --- a/cumulus_library/studies/core/builder_documentreference.py +++ b/cumulus_library/studies/core/builder_documentreference.py @@ -26,7 +26,7 @@ def prepare_queries( parser: databases.DatabaseParser = None, **kwargs, ): - self.queries += sql_utils.denormalize_codes( + self.queries = sql_utils.denormalize_complex_objects( schema, cursor, [ @@ -55,10 +55,11 @@ def prepare_queries( "http://hl7.org/fhir/us/core/ValueSet/us-core-documentreference-category" ], ), - sql_utils.CodeableConceptConfig( + sql_utils.CodingConfig( source_table="documentreference", source_id="id", - column_name="content.format", + column_name="format", + parent_field="content", is_array=False, target_table="core__documentreference_dn_format", ), diff --git a/cumulus_library/studies/core/builder_encounter.py b/cumulus_library/studies/core/builder_encounter.py index 03913471..fb5a1bf0 100644 --- a/cumulus_library/studies/core/builder_encounter.py +++ b/cumulus_library/studies/core/builder_encounter.py @@ -109,7 +109,9 @@ def denormalize_codes(self, schema, cursor): filter_priority=False, ), ] - self.queries += sql_utils.denormalize_codes(schema, cursor, code_configs) + self.queries += sql_utils.denormalize_complex_objects( + schema, cursor, code_configs + ) def prepare_queries( self, diff --git a/cumulus_library/studies/core/builder_medication.py b/cumulus_library/studies/core/builder_medication.py index c85690b4..3f40a150 100644 --- a/cumulus_library/studies/core/builder_medication.py +++ b/cumulus_library/studies/core/builder_medication.py @@ -24,20 +24,23 @@ def _check_data_in_fields(self, cursor, schema: str): } table = "medicationrequest" - base_col = "medicationcodeableconcept" + inline_col = "medicationcodeableconcept" with base_utils.get_progress_bar(transient=True) as progress: task = progress.add_task( "Detecting available medication sources...", - total=7, + total=3, ) # inline medications from FHIR medication - data_types["inline"] = sql_utils.is_codeable_concept_populated( - schema, table, base_col, cursor + data_types["inline"] = sql_utils.is_field_populated( + schema=schema, + source_table=table, + hierarchy=[(inline_col, dict), ("coding", list)], + cursor=cursor, ) if data_types["inline"]: query = base_templates.get_column_datatype_query( - schema, table, [base_col] + schema, table, [inline_col] ) cursor.execute(query) progress.advance(task) @@ -47,27 +50,15 @@ def _check_data_in_fields(self, cursor, schema: str): has_userselected = True else: has_userselected = False - # Validating presence of FHIR medication requests - query = base_templates.get_is_table_not_empty_query( - "medicationrequest", "medicationreference" - ) - cursor.execute(query) - progress.advance(task) - if cursor.fetchone() is None: - return data_types, has_userselected - query = base_templates.get_column_datatype_query( - schema, "medicationrequest", ["medicationreference"] - ) - cursor.execute(query) progress.advance(task) - if "reference" not in cursor.fetchone()[0]: - return data_types, has_userselected - query = base_templates.get_is_table_not_empty_query( - "medicationrequest", "medicationreference.reference" - ) - cursor.execute(query) - progress.advance(task) - if cursor.fetchone() is None: + # Validating presence of FHIR medication requests + if not sql_utils.is_field_populated( + schema=schema, + source_table=table, + hierarchy=[("medicationreference", dict), ("reference", dict)], + expected=["reference"], + cursor=cursor, + ): return data_types, has_userselected # checking med ref contents for our two linkage cases diff --git a/cumulus_library/studies/core/builder_medicationrequest.py b/cumulus_library/studies/core/builder_medicationrequest.py index 890a9dc2..036e22f0 100644 --- a/cumulus_library/studies/core/builder_medicationrequest.py +++ b/cumulus_library/studies/core/builder_medicationrequest.py @@ -55,7 +55,9 @@ def prepare_queries( target_table="core__medicationrequest_dn_medication", ), ] - self.queries += sql_utils.denormalize_codes(schema, cursor, code_sources) + self.queries += sql_utils.denormalize_complex_objects( + schema, cursor, code_sources + ) validated_schema = core_templates.validate_schema( cursor, schema, expected_table_cols, parser ) diff --git a/cumulus_library/studies/core/builder_observation.py b/cumulus_library/studies/core/builder_observation.py index 9caa4114..d0094e35 100644 --- a/cumulus_library/studies/core/builder_observation.py +++ b/cumulus_library/studies/core/builder_observation.py @@ -74,7 +74,9 @@ def prepare_queries( ), ] - self.queries += sql_utils.denormalize_codes(schema, cursor, code_sources) + self.queries += sql_utils.denormalize_complex_objects( + schema, cursor, code_sources + ) validated_schema = core_templates.validate_schema( cursor, schema, expected_table_cols, parser ) diff --git a/cumulus_library/studies/core/builder_patient.py b/cumulus_library/studies/core/builder_patient.py index f6c62e20..984fe871 100644 --- a/cumulus_library/studies/core/builder_patient.py +++ b/cumulus_library/studies/core/builder_patient.py @@ -44,12 +44,12 @@ def prepare_queries( for extension in extension_types: config = sql_utils.ExtensionConfig( - "patient", - "id", - f"core__patient_ext_{extension['name']}", - extension["name"], - extension["fhirpath"], - ["ombCategory", "detailed", "text"], + 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(base_templates.get_extension_denormalize_query(config)) diff --git a/cumulus_library/studies/core/reference_sql/builder_documentreference.sql b/cumulus_library/studies/core/reference_sql/builder_documentreference.sql index 0bb5b4a9..bf07438d 100644 --- a/cumulus_library/studies/core/reference_sql/builder_documentreference.sql +++ b/cumulus_library/studies/core/reference_sql/builder_documentreference.sql @@ -12,8 +12,8 @@ CREATE TABLE core__documentreference_dn_type AS ( system_type_0 AS ( SELECT DISTINCT s.id AS id, - u.codeable_concept.code AS code, - u.codeable_concept.display AS display, + u.codeable_concept.code, + u.codeable_concept.display, u.codeable_concept.system AS code_system FROM documentreference AS s, @@ -47,8 +47,8 @@ CREATE TABLE core__documentreference_dn_category AS ( SELECT DISTINCT s.id AS id, '0' AS priority, - u.codeable_concept.code AS code, - u.codeable_concept.display AS display, + u.codeable_concept.code, + u.codeable_concept.display, u.codeable_concept.system AS code_system FROM documentreference AS s, @@ -98,15 +98,38 @@ CREATE TABLE core__documentreference_dn_category AS ( -- ########################################################### -CREATE TABLE IF NOT EXISTS "main"."core__documentreference_dn_format" -AS ( - SELECT * FROM ( - VALUES - (cast(NULL AS varchar),cast(NULL AS varchar),cast(NULL AS varchar),cast(NULL AS varchar)) +CREATE TABLE core__documentreference_dn_format AS ( + WITH + + system_format_0 AS ( + SELECT DISTINCT + s.id AS id, + u.codeable_concept.code, + u.codeable_concept.display, + u.codeable_concept.system AS code_system + FROM + documentreference AS s, + UNNEST(s.format.coding) AS u (codeable_concept) + ), --noqa: LT07 + + union_table AS ( + SELECT + id, + code_system, + code, + display + FROM system_format_0 + ) - AS t ("id","code","code_system","display") + SELECT + id, + code, + code_system, + display + FROM union_table ); + -- ########################################################### diff --git a/cumulus_library/studies/discovery/code_detection.py b/cumulus_library/studies/discovery/code_detection.py index 5642c97d..487a7fcd 100644 --- a/cumulus_library/studies/discovery/code_detection.py +++ b/cumulus_library/studies/discovery/code_detection.py @@ -12,24 +12,27 @@ def _check_coding_against_db(self, code_source, schema, cursor): """selects the appropriate DB query to run""" if code_source["is_array"]: - return sql_utils.is_codeable_concept_array_populated( - schema, - code_source["table_name"], - code_source["column_name"], - cursor, + return sql_utils.is_field_populated( + schema=schema, + source_table=code_source["table_name"], + hierarchy=[(code_source["column_name"], list), ("coding", list)], + expected=[code_source["column_name"], *sql_utils.CODING], + cursor=cursor, ) elif code_source["is_bare_coding"]: - return sql_utils.is_code_populated( - schema, - code_source["table_name"], - code_source["column_name"], - cursor, + return sql_utils.is_field_populated( + schema=schema, + source_table=code_source["table_name"], + hierarchy=[(code_source["column_name"], dict)], + expected=sql_utils.CODING, + cursor=cursor, ) - return sql_utils.is_codeable_concept_populated( - schema, - code_source["table_name"], - code_source["column_name"], - cursor, + return sql_utils.is_field_populated( + schema=schema, + source_table=code_source["table_name"], + hierarchy=[(code_source["column_name"], dict), ("coding", list)], + expected=[code_source["column_name"], *sql_utils.CODING], + cursor=cursor, ) def _check_codes_in_fields(self, code_sources: list[dict], schema, cursor) -> dict: @@ -72,7 +75,6 @@ def prepare_queries(self, cursor: object, schema: str, *args, **kwargs): for key in code_definition.keys(): code_source[key] = code_definition[key] code_sources.append(code_source) - code_sources = self._check_codes_in_fields(code_sources, schema, cursor) query = base_templates.get_code_system_pairs( "discovery__code_sources", code_sources diff --git a/cumulus_library/template_sql/base_templates.py b/cumulus_library/template_sql/base_templates.py index 331ce42c..a4278b3d 100644 --- a/cumulus_library/template_sql/base_templates.py +++ b/cumulus_library/template_sql/base_templates.py @@ -90,6 +90,37 @@ def get_codeable_concept_denormalize_query( ) +def get_coding_denormalize_query( + config: sql_utils.CodingConfig, +) -> str: + """extracts codings from a specified table. + + This function reimplements get_codeable_concept_denormalize_query targeted + at a bare coding element + + TODO: this is temporary and this should be replaced by a generic DN + query. + + :param config: a CodingConfig + """ + + # If we get a None for code systems, we want one dummy value so the jinja + # for loop will do a single pass. This implicitly means that we're not + # filtering, so this parameter will be otherwise ignored + config.code_systems = config.code_systems or ["all"] + return get_base_template( + "coding_denormalize", + source_table=config.source_table, + source_id=config.source_id, + column_name=config.column_name, + parent_field=config.parent_field, + is_array=config.is_array, + target_table=config.target_table, + filter_priority=config.filter_priority, + code_systems=config.code_systems, + ) + + def get_column_datatype_query( schema_name: str, table_names: str | list, diff --git a/cumulus_library/template_sql/code_system_pairs.sql.jinja b/cumulus_library/template_sql/code_system_pairs.sql.jinja index 43f0369b..8d08f9d3 100644 --- a/cumulus_library/template_sql/code_system_pairs.sql.jinja +++ b/cumulus_library/template_sql/code_system_pairs.sql.jinja @@ -33,13 +33,11 @@ UNNEST({{ source.column_name }}.coding) AS t (row) SELECT * FROM ( VALUES ( - ( - '{{ source.table_name }}', - '{{ source.column_name }}', - '', - '', - '' - ) + '{{ source.table_name }}', + '{{ source.column_name }}', + '', + '', + '' ) ) AS t (table_name, column_name, code, display, system) diff --git a/cumulus_library/template_sql/coding_denormalize.sql.jinja b/cumulus_library/template_sql/coding_denormalize.sql.jinja new file mode 100644 index 00000000..44c6ba65 --- /dev/null +++ b/cumulus_library/template_sql/coding_denormalize.sql.jinja @@ -0,0 +1,74 @@ +{%- import 'syntax.sql.jinja' as syntax -%} +CREATE TABLE {{ target_table }} AS ( + WITH + {%- for system in code_systems %} + + system_{{ column_name }}_{{ loop.index0 }} AS ( + SELECT DISTINCT + s.{{ source_id }} AS id, + {%- if filter_priority %} + '{{ loop.index0 }}' AS priority, + {%- endif %} + u.parent_col.{{ column_name }}.code, + u.parent_col.{{ column_name }}.display, + u.parent_col.{{ column_name }}.system AS code_system + FROM + {{ source_table }} AS s, + UNNEST(s.{{ parent_field }}) AS u (parent_col) + {%- if filter_priority %} + WHERE + u.parent_col.{{ column_name }}.system LIKE '{{ system }}' + {%- endif %} + ), --noqa: LT07 + {%- endfor %} + + union_table AS ( + {%- for system in code_systems %} + SELECT + id, + {%- if filter_priority %} + priority, + {%- endif %} + code_system, + code, + display + FROM system_{{ column_name }}_{{ loop.index0 }} + {{ syntax.union_delineate(loop) }} + {%- endfor %} + ) + {%- if filter_priority -%}, + + partitioned_table AS ( + SELECT + id, + code, + code_system, + display, + priority, + ROW_NUMBER() + OVER ( + PARTITION BY id + ORDER BY priority ASC + ) AS available_priority + FROM union_table + GROUP BY id, priority, code_system, code, display + ORDER BY priority ASC + ) + + SELECT + id, + code, + code_system, + display + FROM partitioned_table + WHERE available_priority = 1 +); +{% else %} + SELECT + id, + code, + code_system, + display + FROM union_table +); +{% endif %} diff --git a/cumulus_library/template_sql/sql_utils.py b/cumulus_library/template_sql/sql_utils.py index e1849996..f5b93969 100644 --- a/cumulus_library/template_sql/sql_utils.py +++ b/cumulus_library/template_sql/sql_utils.py @@ -8,17 +8,31 @@ - Data with deep missing elements - Data which may or may not be in an array depending on context """ - -from dataclasses import dataclass - -import duckdb +import abc +from dataclasses import dataclass, field from cumulus_library import base_utils, databases from cumulus_library.template_sql import base_templates +# TODO: this should be reworked as part of an evenutal typesystem refactor/FHIRClient +# cutover, possibly tied to a database parser update + +CODING = ["code", "system", "display"] + + +@dataclass(kw_only=True) +class ComplexObjectConfig(abc.ABC): + """ABC for handling table detection/denormalization of objects in SQL""" + + source_table: str = None + source_id: str = "id" + target_table: str = None + is_array: bool = False + has_data: bool = False + @dataclass(kw_only=True) -class CodeableConceptConfig: +class CodeableConceptConfig(ComplexObjectConfig): """Holds parameters for generating codableconcept tables. :param column_name: the column containing the codeableConcept you want to extract. @@ -34,17 +48,22 @@ class CodeableConceptConfig: """ column_name: str - is_array: bool - source_table: str = None - target_table: str = None - source_id: str = "id" filter_priority: bool = False code_systems: list = None - has_data: bool = False + expected: list = field(default_factory=lambda: ["code", "system", "display"]) + + +@dataclass(kw_only=True) +class CodingConfig(ComplexObjectConfig): + parent_field: str + column_name: str + filter_priority: bool = False + code_systems: list = None + expected: list = field(default_factory=lambda: ["code", "system", "display"]) -@dataclass -class ExtensionConfig: +@dataclass(kw_only=True) +class ExtensionConfig(ComplexObjectConfig): """convenience class for holding parameters for generating extension tables. :param source_table: the table to extract extensions from @@ -56,13 +75,9 @@ class ExtensionConfig: :param is_array: a boolean indicating if the targeted field is an array type """ - source_table: str - source_id: str - target_table: str target_col_prefix: str fhir_extension: str ext_systems: list[str] - is_array: bool = False def _check_data_in_fields( @@ -97,162 +112,115 @@ def _check_data_in_fields( total=len(code_sources), ) for code_source in code_sources: - if code_source.is_array: - code_source.has_data = is_codeable_concept_array_populated( - schema, code_source.source_table, code_source.column_name, cursor - ) - else: - code_source.has_data = is_codeable_concept_populated( - schema, code_source.source_table, code_source.column_name, cursor - ) + code_source.has_data = is_field_populated( + schema=schema, + cursor=cursor, + source_table=code_source.source_table, + hierarchy=(("category", list), ("coding", list)), + expected=code_source.expected, + ) progress.advance(task) return code_sources -def denormalize_codes( +def denormalize_complex_objects( schema: str, cursor: databases.DatabaseCursor, - code_sources: list[CodeableConceptConfig], + code_sources: list[ComplexObjectConfig], ): queries = [] code_sources = _check_data_in_fields(schema, cursor, code_sources) for code_source in code_sources: - if code_source.has_data: - queries.append( - base_templates.get_codeable_concept_denormalize_query(code_source) - ) - else: - queries.append( - base_templates.get_ctas_empty_query( - schema_name=schema, - table_name=code_source.target_table, - table_cols=["id", "code", "code_system", "display"], - ) - ) - return queries - - -def is_codeable_concept_populated( - schema: str, - table: str, - base_col: str, - cursor, - coding_element="coding", -) -> bool: - """Check db to see if codeableconcept data exists. - - Will execute several exploratory queries to see if the column in question - can be queried naively. + # TODO: This method of pairing classed config objects to + # specific queries should be considered temporary. This should be + # replaced at some point by a more generic table schema traversal/ + # generic jinja template approach. + match code_source: + case CodeableConceptConfig(): + if code_source.has_data: + queries.append( + base_templates.get_codeable_concept_denormalize_query( + code_source + ) + ) + else: + queries.append( + base_templates.get_ctas_empty_query( + schema_name=schema, + table_name=code_source.target_table, + table_cols=["id", "code", "code_system", "display"], + ) + ) + case CodingConfig(): + if code_source.has_data: + queries.append( + base_templates.get_coding_denormalize_query(code_source) + ) + else: + queries.append( + base_templates.get_ctas_empty_query( + schema_name=schema, + table_name=code_source.target_table, + table_cols=["id", "code", "code_system", "display"], + ) + ) - :param schema: The schema/database name - :param table: The table to query against - :param base_col: the place to start validation from. - This can be a nested element, like column.object.code - :param cursor: a PEP-249 compliant database cursor - :param coding_element: the place inside the code element to look for coding info. - default: 'coding' (and :hopefully: this is always right) - :returns: a boolean indicating if valid data is present. - """ - try: - if not _check_schema_if_exists(schema, table, base_col, cursor, coding_element): - return False - - query = base_templates.get_is_table_not_empty_query( - table, - "t1.row1", - [ - { - "source_col": f"{base_col}.coding", - "table_alias": "t1", - "row_alias": "row1", - } - ], - ) - cursor.execute(query) - if cursor.fetchone() is None: - return False - return True - except duckdb.duckdb.BinderException: - return False - - -def is_codeable_concept_array_populated( - schema: str, - table: str, - base_col: str, - cursor, - coding_element="coding", -) -> bool: - """Check db to see if an array of codeableconcept data exists. - - Will execute several exploratory queries to see if the column in question - can be queried naively. Will advance the associated progress's task by 3 steps. - - :param schema: The schema/database name - :param table: The table to query against - :param base_col: the place to start validation from. - This can be a nested element, like column.object.code - :param cursor: a PEP-249 compliant database cursor - :param coding_element: the place inside the code element to look for coding info. - default: 'coding' (and :hopefully: this is always right) - :returns: a boolean indicating if valid data is present. - """ - try: - if not _check_schema_if_exists(schema, table, base_col, cursor, coding_element): - return False - query = base_templates.get_is_table_not_empty_query( - table, - "t2.row2", - [ - { - "source_col": base_col, - "table_alias": "t1", - "row_alias": "row1", - }, - { - "source_col": "row1.coding", - "table_alias": "t2", - "row_alias": "row2", - }, - ], - ) - cursor.execute(query) - if cursor.fetchone() is None: - return False - return True - except duckdb.duckdb.BinderException: - return False + return queries -def is_code_populated( +def is_field_populated( + *, schema: str, - table: str, - base_col: str, cursor, + source_table: str, + hierarchy: list[tuple], + expected: list | None = None, ) -> bool: - """Check db to see if a bare code exists and is populated. - - Will execute several exploratory queries to see if the column in question - can be queried naively. + """Traverses a complex field and determines if it exists and has data :param schema: The schema/database name - :param table: The table to query against - :param base_col: the place to start validation from. - This can be a nested element, like column.object.code :param cursor: a PEP-249 compliant database cursor + :param source_table: The table to query against + :param hierarchy: a list of tuples defining the FHIR path to the element. + Each tuple should be of the form ('element_name', dict | list), where + a dict is a bare nested object and a list is an array object + :param expected: a list of elements that should be present in the field. + If none, we assume it is a CodeableConcept. :returns: a boolean indicating if valid data is present. """ - if not _check_schema_if_exists( - schema, table, base_col, cursor, "coding", check_missing=True + schema=schema, + cursor=cursor, + table=source_table, + base_col=hierarchy[0][0], + target_field=hierarchy[-1][0], + expected=expected, ): return False + unnests = [] + source_field = [] + last_table_alias = None + last_row_alias = None + for element in hierarchy: + if element[1] == list: + unnests.append( + { + "source_col": ".".join([*source_field, element[0]]), + "table_alias": f"{element[0]}_table", + "row_alias": f"{element[0]}_row", + }, + ) + source_field.append(f"{element[0]}_row") + last_table_alias = f"{element[0]}_table" + last_row_alias = f"{element[0]}_row" + source_field = [last_table_alias, last_row_alias] + elif element[1] == dict: + source_field.append(element[0]) query = base_templates.get_is_table_not_empty_query( - table, - base_col, + source_table=source_table, field=".".join(source_field), unnests=unnests ) - cursor.execute(query) - if cursor.fetchone() is None: + res = cursor.execute(query).fetchall() + if len(res) == 0: return False return True @@ -262,32 +230,24 @@ def _check_schema_if_exists( table: str, base_col: str, cursor, - coding_element: str, + target_field: str, + expected=None, check_missing: bool = False, ) -> bool: """Validation check for a column existing, and having the expected schema""" try: query = base_templates.get_is_table_not_empty_query(table, base_col) cursor.execute(query) - if cursor.fetchone() is None: return False query = base_templates.get_column_datatype_query(schema, table, [base_col]) cursor.execute(query) schema_str = str(cursor.fetchone()[1]) - if check_missing: - # This check is for a bare coding, so we're looking for an exclusion of the - # coding element, but still the things that are in a code - required_fields = ["code", "system", "display"] - if any(x not in schema_str for x in required_fields): - return False - if coding_element in schema_str: - return False - else: - required_fields = [coding_element, "code", "system", "display"] - if any(x not in schema_str for x in required_fields): - return False + if expected is None: + expected = [target_field, *CODING] + if any(x not in schema_str.lower() for x in expected): + return False return True except Exception: diff --git a/pyproject.toml b/pyproject.toml index b54cb6da..8bffdeb3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,6 +56,12 @@ build-backend = "flit_core.buildapi" [tool.flit.sdist] include = [".sqlfluff"] +[tool.pytest.ini_options] +minversion = "6.0" +testpaths = [ + "tests", +] + [tool.ruff] target-version = "py310" diff --git a/tests/conftest.py b/tests/conftest.py index 0a25d4a9..b9a92a56 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -31,6 +31,15 @@ } +def get_sorted_table_data(cursor, table): + num_cols = cursor.execute( + f"SELECT count(*) FROM information_schema.columns WHERE table_name='{table}'" + ).fetchone()[0] + return cursor.execute( + f"SELECT * FROM '{table}' ORDER BY " f"{','.join(map(str, range(1,num_cols)))}" + ).fetchall() + + def modify_resource_column( cursor: DatabaseCursor, table: str, col: str, replacement_val ): diff --git a/tests/test_cli.py b/tests/test_cli.py index 69ecc7d8..17700507 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -531,14 +531,14 @@ def test_cli_upload_studies(mock_glob, args, status, login_error, raises): with raises: with requests_mock.Mocker() as r: if login_error: - r.post("https://aggregator.smartcumulus.org/upload/", status_code=401) + r.post("https://upload.url.test/upload/", status_code=401) else: r.post( - "https://aggregator.smartcumulus.org/upload/", - json={"url": "https://presigned.url.org", "fields": {"a": "b"}}, + "https://upload.url.test/upload/", + json={"url": "https://presigned.url.test", "fields": {"a": "b"}}, ) - r.post("https://presigned.url.org", status_code=status) - cli.main(cli_args=args) + r.post("https://presigned.url.test", status_code=status) + cli.main(cli_args=[*args, "--url", "https://upload.url.test/upload/"]) @pytest.mark.parametrize( diff --git a/tests/test_core.py b/tests/test_core.py index ca32c9b7..2d37830c 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -6,18 +6,9 @@ import pytest import toml -from cumulus_library.cli import StudyRunner +from cumulus_library import cli from cumulus_library.studies.core.core_templates import core_templates -from tests.conftest import modify_resource_column - - -def get_sorted_table_data(cursor, table): - num_cols = cursor.execute( - f"SELECT count(*) FROM information_schema.columns WHERE table_name='{table}'" - ).fetchone()[0] - return cursor.execute( - f"SELECT * FROM '{table}' ORDER BY " f"{','.join(map(str, range(1,num_cols)))}" - ).fetchall() +from tests import conftest @pytest.mark.parametrize( @@ -45,7 +36,7 @@ def test_core_tables(mock_db_core, table): # The schema check is to ensure we have a consistent order for the data in # these files, mostly for making git history simpler in case of minor changes - table_rows = get_sorted_table_data(cursor, table) + table_rows = conftest.get_sorted_table_data(cursor, table) # For regenerating data if needed # with open(f"./tests/test_data/core/{table}.txt", "wt", encoding="UTF-8") as f: @@ -73,14 +64,14 @@ def test_core_count_missing_data(tmp_path, mock_db): "version": None, } cursor = mock_db.cursor() - modify_resource_column(cursor, "encounter", "class", null_code_class) + conftest.modify_resource_column(cursor, "encounter", "class", null_code_class) - builder = StudyRunner(mock_db, f"{tmp_path}/data_path/") + builder = cli.StudyRunner(mock_db, f"{tmp_path}/data_path/") builder.clean_and_build_study( f"{Path(__file__).parent.parent}/cumulus_library/studies/core", stats_build=False, ) - table_rows = get_sorted_table_data(cursor, "core__count_encounter_month") + table_rows = conftest.get_sorted_table_data(cursor, "core__count_encounter_month") # For regenerating data if needed # with open( # f"./tests/test_data/core/core__count_encounter_month_missing_data.txt", diff --git a/tests/test_data/core/core__count_encounter_type_month.txt b/tests/test_data/core/core__count_encounter_type_month.txt index ab0a49d8..58441665 100644 --- a/tests/test_data/core/core__count_encounter_type_month.txt +++ b/tests/test_data/core/core__count_encounter_type_month.txt @@ -1,23 +1,47 @@ +(22, 'ambulatory', 'None', 'None', 'None', '2018-06-01') +(22, 'ambulatory', 'None', 'None', None, '2018-06-01') +(22, 'ambulatory', 'None', None, 'None', '2018-06-01') +(22, 'ambulatory', 'None', None, None, '2018-06-01') (22, 'ambulatory', None, 'None', 'None', '2018-06-01') (22, 'ambulatory', None, 'None', None, '2018-06-01') (22, 'ambulatory', None, None, 'None', '2018-06-01') (22, 'ambulatory', None, None, None, '2018-06-01') +(24, 'ambulatory', 'None', 'None', 'None', '2018-07-01') +(24, 'ambulatory', 'None', 'None', None, '2018-07-01') +(24, 'ambulatory', 'None', None, 'None', '2018-07-01') +(24, 'ambulatory', 'None', None, None, '2018-07-01') (24, 'ambulatory', None, 'None', 'None', '2018-07-01') (24, 'ambulatory', None, 'None', None, '2018-07-01') (24, 'ambulatory', None, None, 'None', '2018-07-01') (24, 'ambulatory', None, None, None, '2018-07-01') +(24, None, 'None', 'None', 'None', '2018-06-01') +(24, None, 'None', 'None', None, '2018-06-01') +(24, None, 'None', None, 'None', '2018-06-01') +(24, None, 'None', None, None, '2018-06-01') (24, None, None, 'None', 'None', '2018-06-01') (24, None, None, 'None', None, '2018-06-01') (24, None, None, None, 'None', '2018-06-01') (24, None, None, None, None, '2018-06-01') +(26, None, 'None', 'None', 'None', '2018-07-01') +(26, None, 'None', 'None', None, '2018-07-01') +(26, None, 'None', None, 'None', '2018-07-01') +(26, None, 'None', None, None, '2018-07-01') (26, None, None, 'None', 'None', '2018-07-01') (26, None, None, 'None', None, '2018-07-01') (26, None, None, None, 'None', '2018-07-01') (26, None, None, None, None, '2018-07-01') +(46, 'ambulatory', 'None', 'None', 'None', None) +(46, 'ambulatory', 'None', 'None', None, None) +(46, 'ambulatory', 'None', None, 'None', None) +(46, 'ambulatory', 'None', None, None, None) (46, 'ambulatory', None, 'None', 'None', None) (46, 'ambulatory', None, 'None', None, None) (46, 'ambulatory', None, None, 'None', None) (46, 'ambulatory', None, None, None, None) +(50, None, 'None', 'None', 'None', None) +(50, None, 'None', 'None', None, None) +(50, None, 'None', None, 'None', None) +(50, None, 'None', None, None, None) (50, None, None, 'None', 'None', None) (50, None, None, 'None', None, None) (50, None, None, None, 'None', None) diff --git a/tests/test_data/core/core__documentreference.txt b/tests/test_data/core/core__documentreference.txt index 36b460a9..1b65ef5e 100644 --- a/tests/test_data/core/core__documentreference.txt +++ b/tests/test_data/core/core__documentreference.txt @@ -1,102 +1,102 @@ -('351ea353-4dc6-b0a8-2a70-0e5478e8171e', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/cb8c0665-30ee-479c-8994-d29f1a6848b0', 'Encounter/1d679c3a-2765-5e13-e2a3-4bd76a898fc6', 'DocumentReference/351ea353-4dc6-b0a8-2a70-0e5478e8171e') -('351ea353-4dc6-b0a8-2a70-0e5478e8171e', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/cb8c0665-30ee-479c-8994-d29f1a6848b0', 'Encounter/1d679c3a-2765-5e13-e2a3-4bd76a898fc6', 'DocumentReference/351ea353-4dc6-b0a8-2a70-0e5478e8171e') -('36d0d49a-6346-2856-d614-3f0a1ae85685', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/f9399f0d-5401-09f3-d4ff-89b1aa51b9c8', 'Encounter/6a952afd-3be5-e27e-9e05-5a1e085e34d0', 'DocumentReference/36d0d49a-6346-2856-d614-3f0a1ae85685') -('36d0d49a-6346-2856-d614-3f0a1ae85685', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/f9399f0d-5401-09f3-d4ff-89b1aa51b9c8', 'Encounter/6a952afd-3be5-e27e-9e05-5a1e085e34d0', 'DocumentReference/36d0d49a-6346-2856-d614-3f0a1ae85685') -('37c2d2ba-1976-1167-9bf6-7eb17f3fa35f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/8022fbbe-aaa4-056c-d0f5-ec074bf0656c', 'Encounter/e922a884-7039-a171-a65e-78051fe7afe6', 'DocumentReference/37c2d2ba-1976-1167-9bf6-7eb17f3fa35f') -('37c2d2ba-1976-1167-9bf6-7eb17f3fa35f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/8022fbbe-aaa4-056c-d0f5-ec074bf0656c', 'Encounter/e922a884-7039-a171-a65e-78051fe7afe6', 'DocumentReference/37c2d2ba-1976-1167-9bf6-7eb17f3fa35f') -('3ebf29a1-a116-9d17-5e9a-bad0d6c2d756', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/0b052286-9534-99a8-8d5e-06c2c04a7df7', 'Encounter/e5dabcb6-1d7a-7467-dbba-b864d0d5f5b0', 'DocumentReference/3ebf29a1-a116-9d17-5e9a-bad0d6c2d756') -('3ebf29a1-a116-9d17-5e9a-bad0d6c2d756', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/0b052286-9534-99a8-8d5e-06c2c04a7df7', 'Encounter/e5dabcb6-1d7a-7467-dbba-b864d0d5f5b0', 'DocumentReference/3ebf29a1-a116-9d17-5e9a-bad0d6c2d756') -('3f0e9271-a486-797d-978a-fb2d32d37d47', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 21), datetime.date(2018, 6, 18), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/a46846ca-3f95-2cbb-3a9d-5eae150a0273', 'Encounter/5c3450fb-12f0-08f3-6e4d-8a5e433e19a4', 'DocumentReference/3f0e9271-a486-797d-978a-fb2d32d37d47') -('3f0e9271-a486-797d-978a-fb2d32d37d47', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 21), datetime.date(2018, 6, 18), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/a46846ca-3f95-2cbb-3a9d-5eae150a0273', 'Encounter/5c3450fb-12f0-08f3-6e4d-8a5e433e19a4', 'DocumentReference/3f0e9271-a486-797d-978a-fb2d32d37d47') -('3f578a1b-f50a-9333-3030-306982950658', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/3cf7af45-2bee-aa9c-d524-40b487149d60', 'Encounter/d2782687-6885-037c-957d-579fbd681d2a', 'DocumentReference/3f578a1b-f50a-9333-3030-306982950658') -('3f578a1b-f50a-9333-3030-306982950658', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/3cf7af45-2bee-aa9c-d524-40b487149d60', 'Encounter/d2782687-6885-037c-957d-579fbd681d2a', 'DocumentReference/3f578a1b-f50a-9333-3030-306982950658') -('406679b2-a02c-0003-3b17-56ba373fccff', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/0734762a-9db6-22fc-b595-c3e472bb2a9a', 'Encounter/2f55edb9-a906-0b40-e183-89b1d65d1aa1', 'DocumentReference/406679b2-a02c-0003-3b17-56ba373fccff') -('406679b2-a02c-0003-3b17-56ba373fccff', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/0734762a-9db6-22fc-b595-c3e472bb2a9a', 'Encounter/2f55edb9-a906-0b40-e183-89b1d65d1aa1', 'DocumentReference/406679b2-a02c-0003-3b17-56ba373fccff') -('41eb62dd-7032-e98d-84c6-d494ad8c877b', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, 'final', None, datetime.date(2018, 7, 31), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/2a0e1946-acf6-5a7e-9399-a9cbc4730199', 'Encounter/aabb3ac3-c4a3-f613-9507-63280adb9209', 'DocumentReference/41eb62dd-7032-e98d-84c6-d494ad8c877b') -('41eb62dd-7032-e98d-84c6-d494ad8c877b', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, 'final', None, datetime.date(2018, 7, 31), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/2a0e1946-acf6-5a7e-9399-a9cbc4730199', 'Encounter/aabb3ac3-c4a3-f613-9507-63280adb9209', 'DocumentReference/41eb62dd-7032-e98d-84c6-d494ad8c877b') -('4390dbd1-3bdf-e516-9fe0-a8180181507f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, 'amended', None, datetime.date(2018, 6, 3), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/e80dda2c-a260-dbf7-3167-bf0945f3a91d', 'Encounter/029d1814-d7bf-0624-524d-7ccda5f320f6', 'DocumentReference/4390dbd1-3bdf-e516-9fe0-a8180181507f') -('4390dbd1-3bdf-e516-9fe0-a8180181507f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, 'amended', None, datetime.date(2018, 6, 3), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/e80dda2c-a260-dbf7-3167-bf0945f3a91d', 'Encounter/029d1814-d7bf-0624-524d-7ccda5f320f6', 'DocumentReference/4390dbd1-3bdf-e516-9fe0-a8180181507f') -('4390dbd1-3bdf-e516-9fe0-a8180181507f-error', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, 'entered-in-error', None, datetime.date(2018, 6, 3), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/e80dda2c-a260-dbf7-3167-bf0945f3a91d', 'Encounter/029d1814-d7bf-0624-524d-7ccda5f320f6', 'DocumentReference/4390dbd1-3bdf-e516-9fe0-a8180181507f-error') -('4390dbd1-3bdf-e516-9fe0-a8180181507f-error', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, 'entered-in-error', None, datetime.date(2018, 6, 3), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/e80dda2c-a260-dbf7-3167-bf0945f3a91d', 'Encounter/029d1814-d7bf-0624-524d-7ccda5f320f6', 'DocumentReference/4390dbd1-3bdf-e516-9fe0-a8180181507f-error') -('4439aa6e-fbc2-21a1-208e-095907104a65', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 30), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/82b8a670-4700-30e8-24a0-b83efa3c5e0a', 'Encounter/75b68644-535d-bdc1-4c31-aa9fe7e1822f', 'DocumentReference/4439aa6e-fbc2-21a1-208e-095907104a65') -('4439aa6e-fbc2-21a1-208e-095907104a65', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 30), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/82b8a670-4700-30e8-24a0-b83efa3c5e0a', 'Encounter/75b68644-535d-bdc1-4c31-aa9fe7e1822f', 'DocumentReference/4439aa6e-fbc2-21a1-208e-095907104a65') -('45160ef5-42e8-7239-6633-904308273198', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/3627adb8-f741-acf3-2dd6-10f3bcbe1077', 'Encounter/bca7cabc-b2fc-8a08-c69b-5bc0afa20d80', 'DocumentReference/45160ef5-42e8-7239-6633-904308273198') -('45160ef5-42e8-7239-6633-904308273198', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/3627adb8-f741-acf3-2dd6-10f3bcbe1077', 'Encounter/bca7cabc-b2fc-8a08-c69b-5bc0afa20d80', 'DocumentReference/45160ef5-42e8-7239-6633-904308273198') -('4711ca43-989d-a8f9-5f32-0102640804cf', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/d3c0274f-f42b-8d2b-15f2-82331e723383', 'Encounter/6565ef5c-30b9-8697-6ca6-2b77894d5437', 'DocumentReference/4711ca43-989d-a8f9-5f32-0102640804cf') -('4711ca43-989d-a8f9-5f32-0102640804cf', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/d3c0274f-f42b-8d2b-15f2-82331e723383', 'Encounter/6565ef5c-30b9-8697-6ca6-2b77894d5437', 'DocumentReference/4711ca43-989d-a8f9-5f32-0102640804cf') -('48693636-4eec-ad3d-b71d-8f650bd0a6f1', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/c7ad408d-fcae-b54a-eb1d-26d48f7a5f84', 'Encounter/02eb4e14-1a6f-d968-2c26-c0cf5023afe0', 'DocumentReference/48693636-4eec-ad3d-b71d-8f650bd0a6f1') -('48693636-4eec-ad3d-b71d-8f650bd0a6f1', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/c7ad408d-fcae-b54a-eb1d-26d48f7a5f84', 'Encounter/02eb4e14-1a6f-d968-2c26-c0cf5023afe0', 'DocumentReference/48693636-4eec-ad3d-b71d-8f650bd0a6f1') -('48933dd8-3fcf-416e-89ca-27851e45391f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 29), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/7cef0e6f-9aea-4079-dfc6-18a96454708e', 'Encounter/d735c414-9dd3-c9b1-285c-8da79a7fbbdf', 'DocumentReference/48933dd8-3fcf-416e-89ca-27851e45391f') -('48933dd8-3fcf-416e-89ca-27851e45391f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 29), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/7cef0e6f-9aea-4079-dfc6-18a96454708e', 'Encounter/d735c414-9dd3-c9b1-285c-8da79a7fbbdf', 'DocumentReference/48933dd8-3fcf-416e-89ca-27851e45391f') -('4b2e99d5-d4c2-fd1f-a5fd-96fe9546b58a', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/6385ddd7-2639-6505-3789-0521b8f66c8b', 'Encounter/fd0754a4-e96d-cba7-b3c0-77697a09c86e', 'DocumentReference/4b2e99d5-d4c2-fd1f-a5fd-96fe9546b58a') -('4b2e99d5-d4c2-fd1f-a5fd-96fe9546b58a', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/6385ddd7-2639-6505-3789-0521b8f66c8b', 'Encounter/fd0754a4-e96d-cba7-b3c0-77697a09c86e', 'DocumentReference/4b2e99d5-d4c2-fd1f-a5fd-96fe9546b58a') -('99b390f4-1bcb-21ec-85d5-85cbb74e86ae', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/9eaa056b-1efc-0cc8-70ff-62c8f704cc13', 'Encounter/5c994000-aa78-2be5-e6cf-99f230d50c2f', 'DocumentReference/99b390f4-1bcb-21ec-85d5-85cbb74e86ae') -('99b390f4-1bcb-21ec-85d5-85cbb74e86ae', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/9eaa056b-1efc-0cc8-70ff-62c8f704cc13', 'Encounter/5c994000-aa78-2be5-e6cf-99f230d50c2f', 'DocumentReference/99b390f4-1bcb-21ec-85d5-85cbb74e86ae') -('99d49a34-c515-23a1-c3e4-ef73c3cef727', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 26), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/cc9fb8e2-fe52-b72a-aebb-9d10260f121b', 'Encounter/683b04eb-663a-849f-715f-4ccd70bf1524', 'DocumentReference/99d49a34-c515-23a1-c3e4-ef73c3cef727') -('99d49a34-c515-23a1-c3e4-ef73c3cef727', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 26), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/cc9fb8e2-fe52-b72a-aebb-9d10260f121b', 'Encounter/683b04eb-663a-849f-715f-4ccd70bf1524', 'DocumentReference/99d49a34-c515-23a1-c3e4-ef73c3cef727') -('99e26f8b-a5a2-ad5e-713a-16266b5991a1', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/1c498b42-61fd-6341-69c3-053f6e4fe404', 'Encounter/e613f29d-7505-6f2e-a1f5-bfbec300752d', 'DocumentReference/99e26f8b-a5a2-ad5e-713a-16266b5991a1') -('99e26f8b-a5a2-ad5e-713a-16266b5991a1', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/1c498b42-61fd-6341-69c3-053f6e4fe404', 'Encounter/e613f29d-7505-6f2e-a1f5-bfbec300752d', 'DocumentReference/99e26f8b-a5a2-ad5e-713a-16266b5991a1') -('9a50a40a-8099-5ab5-0903-1ba65d8c0905', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/24906e2c-e556-71dc-23d9-3e1d5fb08986', 'Encounter/1154d05c-8727-9373-4224-25b9fdba9ab3', 'DocumentReference/9a50a40a-8099-5ab5-0903-1ba65d8c0905') -('9a50a40a-8099-5ab5-0903-1ba65d8c0905', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/24906e2c-e556-71dc-23d9-3e1d5fb08986', 'Encounter/1154d05c-8727-9373-4224-25b9fdba9ab3', 'DocumentReference/9a50a40a-8099-5ab5-0903-1ba65d8c0905') -('9ca118c6-e354-5588-3cdc-77ee3b3c8711', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/2da1bee2-2bc2-4511-84e1-42860310e2fb', 'Encounter/d5f342b7-017c-f2e7-8697-5a038c91518e', 'DocumentReference/9ca118c6-e354-5588-3cdc-77ee3b3c8711') -('9ca118c6-e354-5588-3cdc-77ee3b3c8711', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/2da1bee2-2bc2-4511-84e1-42860310e2fb', 'Encounter/d5f342b7-017c-f2e7-8697-5a038c91518e', 'DocumentReference/9ca118c6-e354-5588-3cdc-77ee3b3c8711') -('a1b69e45-11f8-a49f-170e-32004c70e842', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 11), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/5ce2e599-fb6e-9b4d-3c2e-87310619b957', 'Encounter/4b03a408-6694-88e3-0e63-3ee464ecd6cd', 'DocumentReference/a1b69e45-11f8-a49f-170e-32004c70e842') -('a1b69e45-11f8-a49f-170e-32004c70e842', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 11), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/5ce2e599-fb6e-9b4d-3c2e-87310619b957', 'Encounter/4b03a408-6694-88e3-0e63-3ee464ecd6cd', 'DocumentReference/a1b69e45-11f8-a49f-170e-32004c70e842') -('a3964c82-0605-c2b2-97dc-0de17a1ec0ef', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 17), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/7f941bcc-e7b2-99e1-585f-129d0ef1c13d', 'Encounter/65f8fdca-a949-80a0-8072-094e9aaee474', 'DocumentReference/a3964c82-0605-c2b2-97dc-0de17a1ec0ef') -('a3964c82-0605-c2b2-97dc-0de17a1ec0ef', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 17), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/7f941bcc-e7b2-99e1-585f-129d0ef1c13d', 'Encounter/65f8fdca-a949-80a0-8072-094e9aaee474', 'DocumentReference/a3964c82-0605-c2b2-97dc-0de17a1ec0ef') -('a5231f35-ad14-580e-1888-55c1b383aa11', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/3ae095ec-8fe0-133b-36d4-8785a6ad8df3', 'Encounter/75312bd2-d5ac-c62e-c9df-0004783725c7', 'DocumentReference/a5231f35-ad14-580e-1888-55c1b383aa11') -('a5231f35-ad14-580e-1888-55c1b383aa11', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/3ae095ec-8fe0-133b-36d4-8785a6ad8df3', 'Encounter/75312bd2-d5ac-c62e-c9df-0004783725c7', 'DocumentReference/a5231f35-ad14-580e-1888-55c1b383aa11') -('a59ca653-b95d-09d2-9fa5-a1b492d85a5f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 28), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/c20e5afd-30df-ac3d-6684-cc29438a9bc4', 'Encounter/b864bcd8-14e0-8bec-b7cc-f8629d91470e', 'DocumentReference/a59ca653-b95d-09d2-9fa5-a1b492d85a5f') -('a59ca653-b95d-09d2-9fa5-a1b492d85a5f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 28), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/c20e5afd-30df-ac3d-6684-cc29438a9bc4', 'Encounter/b864bcd8-14e0-8bec-b7cc-f8629d91470e', 'DocumentReference/a59ca653-b95d-09d2-9fa5-a1b492d85a5f') -('a69150c5-2fbe-2284-1eb5-e11146858a22', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 1), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/9c8d8539-0b1e-73e2-b64f-83f1ea601fa4', 'Encounter/f2752dd7-1bf1-739d-dd8c-40122d0b63bc', 'DocumentReference/a69150c5-2fbe-2284-1eb5-e11146858a22') -('a69150c5-2fbe-2284-1eb5-e11146858a22', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 1), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/9c8d8539-0b1e-73e2-b64f-83f1ea601fa4', 'Encounter/f2752dd7-1bf1-739d-dd8c-40122d0b63bc', 'DocumentReference/a69150c5-2fbe-2284-1eb5-e11146858a22') -('a7115116-f8da-3960-e3ed-f1f0d89646c3', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 2), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/8877ef1f-7cd7-3242-d7f0-73cf3f7165f4', 'Encounter/299b6495-3fe7-8db3-c494-6e1ce8b7986d', 'DocumentReference/a7115116-f8da-3960-e3ed-f1f0d89646c3') -('a7115116-f8da-3960-e3ed-f1f0d89646c3', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 2), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/8877ef1f-7cd7-3242-d7f0-73cf3f7165f4', 'Encounter/299b6495-3fe7-8db3-c494-6e1ce8b7986d', 'DocumentReference/a7115116-f8da-3960-e3ed-f1f0d89646c3') -('a79da4dd-83bc-5b6a-db34-bd35b3acbd2c', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 6), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/19158de4-66a2-f70f-e3bf-4396b312c8f1', 'Encounter/ed151e04-3dd6-8cb7-a3e5-777c8a8667f1', 'DocumentReference/a79da4dd-83bc-5b6a-db34-bd35b3acbd2c') -('a79da4dd-83bc-5b6a-db34-bd35b3acbd2c', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 6), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/19158de4-66a2-f70f-e3bf-4396b312c8f1', 'Encounter/ed151e04-3dd6-8cb7-a3e5-777c8a8667f1', 'DocumentReference/a79da4dd-83bc-5b6a-db34-bd35b3acbd2c') -('a95df5ea-7005-9e98-e97a-1ade6967b585', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 16), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/16be855b-ece2-8b96-1ef9-a4d93adf3289', 'Encounter/83d0d564-3bbf-48eb-7445-bd2b81130671', 'DocumentReference/a95df5ea-7005-9e98-e97a-1ade6967b585') -('a95df5ea-7005-9e98-e97a-1ade6967b585', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 16), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/16be855b-ece2-8b96-1ef9-a4d93adf3289', 'Encounter/83d0d564-3bbf-48eb-7445-bd2b81130671', 'DocumentReference/a95df5ea-7005-9e98-e97a-1ade6967b585') -('a96ba3b7-a461-5849-1881-d372e0460ccc', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 14), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/26a3984f-b2a8-e67f-7abc-ff147a0e6e35', 'Encounter/79d8f213-7847-646b-8a66-5da208cc1c27', 'DocumentReference/a96ba3b7-a461-5849-1881-d372e0460ccc') -('a96ba3b7-a461-5849-1881-d372e0460ccc', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 14), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/26a3984f-b2a8-e67f-7abc-ff147a0e6e35', 'Encounter/79d8f213-7847-646b-8a66-5da208cc1c27', 'DocumentReference/a96ba3b7-a461-5849-1881-d372e0460ccc') -('ac0439bc-e450-d339-da6d-5ead96d8b346', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 30), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/2858705f-5af1-9869-4d94-894e09a9f99a', 'Encounter/de9d67de-6ae3-32f7-20f2-e719ae23a9a3', 'DocumentReference/ac0439bc-e450-d339-da6d-5ead96d8b346') -('ac0439bc-e450-d339-da6d-5ead96d8b346', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 30), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/2858705f-5af1-9869-4d94-894e09a9f99a', 'Encounter/de9d67de-6ae3-32f7-20f2-e719ae23a9a3', 'DocumentReference/ac0439bc-e450-d339-da6d-5ead96d8b346') -('ad2bee76-6e59-5d8b-21ed-b30cdb784198', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 9), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/e455ca3f-fc16-6ffc-297a-adc27e2db183', 'Encounter/98d4bd14-d78e-debb-e7dc-2df7786aedf3', 'DocumentReference/ad2bee76-6e59-5d8b-21ed-b30cdb784198') -('ad2bee76-6e59-5d8b-21ed-b30cdb784198', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 9), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/e455ca3f-fc16-6ffc-297a-adc27e2db183', 'Encounter/98d4bd14-d78e-debb-e7dc-2df7786aedf3', 'DocumentReference/ad2bee76-6e59-5d8b-21ed-b30cdb784198') -('b1f5c114-8e28-08c0-0193-0855aa10c97f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/c7c5c028-f1fb-962b-8db2-dfd4c6d6b02a', 'Encounter/aa890974-162f-5906-dc71-2bb6d2185314', 'DocumentReference/b1f5c114-8e28-08c0-0193-0855aa10c97f') -('b1f5c114-8e28-08c0-0193-0855aa10c97f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/c7c5c028-f1fb-962b-8db2-dfd4c6d6b02a', 'Encounter/aa890974-162f-5906-dc71-2bb6d2185314', 'DocumentReference/b1f5c114-8e28-08c0-0193-0855aa10c97f') -('b2896621-57ef-1ad3-91c5-389dce96973b', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 7), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/ac91b90d-97e4-4fc5-41cd-036bac49e6e8', 'Encounter/dc5ed645-3979-e765-3e03-6ba2173027c3', 'DocumentReference/b2896621-57ef-1ad3-91c5-389dce96973b') -('b2896621-57ef-1ad3-91c5-389dce96973b', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 7), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/ac91b90d-97e4-4fc5-41cd-036bac49e6e8', 'Encounter/dc5ed645-3979-e765-3e03-6ba2173027c3', 'DocumentReference/b2896621-57ef-1ad3-91c5-389dce96973b') -('b3357397-9f4c-7d00-06af-18f03c63d583', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/c1bfec36-dc2c-afc8-c767-3d35ed2bf6f0', 'Encounter/8ff1dc01-5a28-b2d8-3b42-4b7a7d539970', 'DocumentReference/b3357397-9f4c-7d00-06af-18f03c63d583') -('b3357397-9f4c-7d00-06af-18f03c63d583', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/c1bfec36-dc2c-afc8-c767-3d35ed2bf6f0', 'Encounter/8ff1dc01-5a28-b2d8-3b42-4b7a7d539970', 'DocumentReference/b3357397-9f4c-7d00-06af-18f03c63d583') -('b339c2e8-35eb-1838-7eea-5a04c81695df', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/267fc42d-cd9e-8527-1f9e-887fe7776147', 'Encounter/4c4d0730-201f-5b75-c657-8d0de09cc28f', 'DocumentReference/b339c2e8-35eb-1838-7eea-5a04c81695df') -('b339c2e8-35eb-1838-7eea-5a04c81695df', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/267fc42d-cd9e-8527-1f9e-887fe7776147', 'Encounter/4c4d0730-201f-5b75-c657-8d0de09cc28f', 'DocumentReference/b339c2e8-35eb-1838-7eea-5a04c81695df') -('b39532e8-ee15-a7c4-cac5-353a8be67d15', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 8), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/6a883108-7b87-120b-d163-d369336e04e5', 'Encounter/2b1ee164-6c87-420d-a9e2-6c235ebeef71', 'DocumentReference/b39532e8-ee15-a7c4-cac5-353a8be67d15') -('b39532e8-ee15-a7c4-cac5-353a8be67d15', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 8), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/6a883108-7b87-120b-d163-d369336e04e5', 'Encounter/2b1ee164-6c87-420d-a9e2-6c235ebeef71', 'DocumentReference/b39532e8-ee15-a7c4-cac5-353a8be67d15') -('b44d277c-7c09-a39b-97e9-1e96d71b6978', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/7bf52d54-0d2a-265a-15aa-eeed7aaf4af6', 'Encounter/ba84689e-2f9f-7cea-af1f-d69ffdd3a3eb', 'DocumentReference/b44d277c-7c09-a39b-97e9-1e96d71b6978') -('b44d277c-7c09-a39b-97e9-1e96d71b6978', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/7bf52d54-0d2a-265a-15aa-eeed7aaf4af6', 'Encounter/ba84689e-2f9f-7cea-af1f-d69ffdd3a3eb', 'DocumentReference/b44d277c-7c09-a39b-97e9-1e96d71b6978') -('b58f7768-64be-6c0f-1b82-3deffdef1076', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/a28be3e1-a6bd-7df4-fc81-1140848f8453', 'Encounter/91f94a9d-69a7-e30a-cd1a-68c52dc01e70', 'DocumentReference/b58f7768-64be-6c0f-1b82-3deffdef1076') -('b58f7768-64be-6c0f-1b82-3deffdef1076', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/a28be3e1-a6bd-7df4-fc81-1140848f8453', 'Encounter/91f94a9d-69a7-e30a-cd1a-68c52dc01e70', 'DocumentReference/b58f7768-64be-6c0f-1b82-3deffdef1076') -('b73493d0-e2f4-9aa6-cdad-920f7c126d6c', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 16), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/50f8b42e-17a6-e932-8546-da94004c597c', 'Encounter/37604257-be1a-120f-81ee-336f81603f92', 'DocumentReference/b73493d0-e2f4-9aa6-cdad-920f7c126d6c') -('b73493d0-e2f4-9aa6-cdad-920f7c126d6c', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 16), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/50f8b42e-17a6-e932-8546-da94004c597c', 'Encounter/37604257-be1a-120f-81ee-336f81603f92', 'DocumentReference/b73493d0-e2f4-9aa6-cdad-920f7c126d6c') -('b7b68006-53d5-b823-d193-56b262f45e8b', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/ad3ed58a-5645-af0a-eeca-ab543123a8aa', 'Encounter/03e34b19-2889-b828-792d-2a83400c55be', 'DocumentReference/b7b68006-53d5-b823-d193-56b262f45e8b') -('b7b68006-53d5-b823-d193-56b262f45e8b', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/ad3ed58a-5645-af0a-eeca-ab543123a8aa', 'Encounter/03e34b19-2889-b828-792d-2a83400c55be', 'DocumentReference/b7b68006-53d5-b823-d193-56b262f45e8b') -('b953a85f-f18b-d7a3-8974-ba44e0a3141c', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 5), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/a5bc08ea-9462-c4f5-1bd2-ff342598ac99', 'Encounter/f964be66-3fcd-95c8-0021-71c7d24c91b7', 'DocumentReference/b953a85f-f18b-d7a3-8974-ba44e0a3141c') -('b953a85f-f18b-d7a3-8974-ba44e0a3141c', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 5), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/a5bc08ea-9462-c4f5-1bd2-ff342598ac99', 'Encounter/f964be66-3fcd-95c8-0021-71c7d24c91b7', 'DocumentReference/b953a85f-f18b-d7a3-8974-ba44e0a3141c') -('b985a70c-9504-b7b3-0707-f8381ba77976', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/149de67a-2809-59a8-bfa2-36df509021dc', 'Encounter/beb26500-4ccd-ce0a-44f6-74f44be5fafe', 'DocumentReference/b985a70c-9504-b7b3-0707-f8381ba77976') -('b985a70c-9504-b7b3-0707-f8381ba77976', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/149de67a-2809-59a8-bfa2-36df509021dc', 'Encounter/beb26500-4ccd-ce0a-44f6-74f44be5fafe', 'DocumentReference/b985a70c-9504-b7b3-0707-f8381ba77976') -('ba0abbd6-49a9-95fa-2396-7118c56da8c6', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 12), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/9b17654f-a902-3d56-9000-4ade3dd3059f', 'Encounter/ca45bbef-ef2a-3b3c-ea5e-76bcd5865780', 'DocumentReference/ba0abbd6-49a9-95fa-2396-7118c56da8c6') -('ba0abbd6-49a9-95fa-2396-7118c56da8c6', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 12), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/9b17654f-a902-3d56-9000-4ade3dd3059f', 'Encounter/ca45bbef-ef2a-3b3c-ea5e-76bcd5865780', 'DocumentReference/ba0abbd6-49a9-95fa-2396-7118c56da8c6') -('bcbaa9d3-d7cf-3f5f-44d3-32c8a267f991', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/17fde357-dcc9-af8b-a8d3-4bd213afeb22', 'Encounter/32d0ae2d-1be8-9e90-a4da-4c222abd88a9', 'DocumentReference/bcbaa9d3-d7cf-3f5f-44d3-32c8a267f991') -('bcbaa9d3-d7cf-3f5f-44d3-32c8a267f991', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/17fde357-dcc9-af8b-a8d3-4bd213afeb22', 'Encounter/32d0ae2d-1be8-9e90-a4da-4c222abd88a9', 'DocumentReference/bcbaa9d3-d7cf-3f5f-44d3-32c8a267f991') -('bd60a52b-65b9-f26d-03e4-282850509f03', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/51032f44-d514-26e9-3e85-e956561c076e', 'Encounter/d73ed087-e0ae-78e0-7a05-1bac1060c476', 'DocumentReference/bd60a52b-65b9-f26d-03e4-282850509f03') -('bd60a52b-65b9-f26d-03e4-282850509f03', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/51032f44-d514-26e9-3e85-e956561c076e', 'Encounter/d73ed087-e0ae-78e0-7a05-1bac1060c476', 'DocumentReference/bd60a52b-65b9-f26d-03e4-282850509f03') -('bfddb0ff-1296-107e-76ca-14b4a14db9ce', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/26baae20-c8c5-003a-ab6b-ebcc49be20db', 'Encounter/c6ec2350-43d4-abab-2e84-4d2aadb337a7', 'DocumentReference/bfddb0ff-1296-107e-76ca-14b4a14db9ce') -('bfddb0ff-1296-107e-76ca-14b4a14db9ce', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/26baae20-c8c5-003a-ab6b-ebcc49be20db', 'Encounter/c6ec2350-43d4-abab-2e84-4d2aadb337a7', 'DocumentReference/bfddb0ff-1296-107e-76ca-14b4a14db9ce') -('c18dbe84-be31-cee5-1f2e-cf163cdd3e3f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 27), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/a5b171a7-9b28-20e7-86a7-936ecbf55f36', 'Encounter/c4605953-3103-ede6-e0c0-e0588e6f019e', 'DocumentReference/c18dbe84-be31-cee5-1f2e-cf163cdd3e3f') -('c18dbe84-be31-cee5-1f2e-cf163cdd3e3f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 27), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/a5b171a7-9b28-20e7-86a7-936ecbf55f36', 'Encounter/c4605953-3103-ede6-e0c0-e0588e6f019e', 'DocumentReference/c18dbe84-be31-cee5-1f2e-cf163cdd3e3f') -('c6598486-8276-b44a-286e-b376143f7efc', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 25), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/47c37c92-5932-9cfe-66be-208556780fe0', 'Encounter/b5974881-ae62-ddd6-b905-8c86c1ca9e33', 'DocumentReference/c6598486-8276-b44a-286e-b376143f7efc') -('c6598486-8276-b44a-286e-b376143f7efc', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 25), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/47c37c92-5932-9cfe-66be-208556780fe0', 'Encounter/b5974881-ae62-ddd6-b905-8c86c1ca9e33', 'DocumentReference/c6598486-8276-b44a-286e-b376143f7efc') -('c6c64129-9dfa-840d-3309-a5590cc74f2e', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/ad239efc-637c-e428-c829-b87e700d5446', 'Encounter/366df7d3-2ea9-db22-7cdd-60fa8a5c45ca', 'DocumentReference/c6c64129-9dfa-840d-3309-a5590cc74f2e') -('c6c64129-9dfa-840d-3309-a5590cc74f2e', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/ad239efc-637c-e428-c829-b87e700d5446', 'Encounter/366df7d3-2ea9-db22-7cdd-60fa8a5c45ca', 'DocumentReference/c6c64129-9dfa-840d-3309-a5590cc74f2e') -('c84e67e9-4ea8-700b-9f2b-c0179e803d4f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/dffa62dc-8ec2-1cd6-ee75-f9156a5283fe', 'Encounter/11381dc6-0e06-da55-0735-d1e7bbf8bb35', 'DocumentReference/c84e67e9-4ea8-700b-9f2b-c0179e803d4f') -('c84e67e9-4ea8-700b-9f2b-c0179e803d4f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/dffa62dc-8ec2-1cd6-ee75-f9156a5283fe', 'Encounter/11381dc6-0e06-da55-0735-d1e7bbf8bb35', 'DocumentReference/c84e67e9-4ea8-700b-9f2b-c0179e803d4f') +('351ea353-4dc6-b0a8-2a70-0e5478e8171e', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/cb8c0665-30ee-479c-8994-d29f1a6848b0', 'Encounter/1d679c3a-2765-5e13-e2a3-4bd76a898fc6', 'DocumentReference/351ea353-4dc6-b0a8-2a70-0e5478e8171e') +('351ea353-4dc6-b0a8-2a70-0e5478e8171e', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/cb8c0665-30ee-479c-8994-d29f1a6848b0', 'Encounter/1d679c3a-2765-5e13-e2a3-4bd76a898fc6', 'DocumentReference/351ea353-4dc6-b0a8-2a70-0e5478e8171e') +('36d0d49a-6346-2856-d614-3f0a1ae85685', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/f9399f0d-5401-09f3-d4ff-89b1aa51b9c8', 'Encounter/6a952afd-3be5-e27e-9e05-5a1e085e34d0', 'DocumentReference/36d0d49a-6346-2856-d614-3f0a1ae85685') +('36d0d49a-6346-2856-d614-3f0a1ae85685', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/f9399f0d-5401-09f3-d4ff-89b1aa51b9c8', 'Encounter/6a952afd-3be5-e27e-9e05-5a1e085e34d0', 'DocumentReference/36d0d49a-6346-2856-d614-3f0a1ae85685') +('37c2d2ba-1976-1167-9bf6-7eb17f3fa35f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/8022fbbe-aaa4-056c-d0f5-ec074bf0656c', 'Encounter/e922a884-7039-a171-a65e-78051fe7afe6', 'DocumentReference/37c2d2ba-1976-1167-9bf6-7eb17f3fa35f') +('37c2d2ba-1976-1167-9bf6-7eb17f3fa35f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/8022fbbe-aaa4-056c-d0f5-ec074bf0656c', 'Encounter/e922a884-7039-a171-a65e-78051fe7afe6', 'DocumentReference/37c2d2ba-1976-1167-9bf6-7eb17f3fa35f') +('3ebf29a1-a116-9d17-5e9a-bad0d6c2d756', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/0b052286-9534-99a8-8d5e-06c2c04a7df7', 'Encounter/e5dabcb6-1d7a-7467-dbba-b864d0d5f5b0', 'DocumentReference/3ebf29a1-a116-9d17-5e9a-bad0d6c2d756') +('3ebf29a1-a116-9d17-5e9a-bad0d6c2d756', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/0b052286-9534-99a8-8d5e-06c2c04a7df7', 'Encounter/e5dabcb6-1d7a-7467-dbba-b864d0d5f5b0', 'DocumentReference/3ebf29a1-a116-9d17-5e9a-bad0d6c2d756') +('3f0e9271-a486-797d-978a-fb2d32d37d47', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 21), datetime.date(2018, 6, 18), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/a46846ca-3f95-2cbb-3a9d-5eae150a0273', 'Encounter/5c3450fb-12f0-08f3-6e4d-8a5e433e19a4', 'DocumentReference/3f0e9271-a486-797d-978a-fb2d32d37d47') +('3f0e9271-a486-797d-978a-fb2d32d37d47', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 21), datetime.date(2018, 6, 18), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/a46846ca-3f95-2cbb-3a9d-5eae150a0273', 'Encounter/5c3450fb-12f0-08f3-6e4d-8a5e433e19a4', 'DocumentReference/3f0e9271-a486-797d-978a-fb2d32d37d47') +('3f578a1b-f50a-9333-3030-306982950658', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/3cf7af45-2bee-aa9c-d524-40b487149d60', 'Encounter/d2782687-6885-037c-957d-579fbd681d2a', 'DocumentReference/3f578a1b-f50a-9333-3030-306982950658') +('3f578a1b-f50a-9333-3030-306982950658', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/3cf7af45-2bee-aa9c-d524-40b487149d60', 'Encounter/d2782687-6885-037c-957d-579fbd681d2a', 'DocumentReference/3f578a1b-f50a-9333-3030-306982950658') +('406679b2-a02c-0003-3b17-56ba373fccff', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/0734762a-9db6-22fc-b595-c3e472bb2a9a', 'Encounter/2f55edb9-a906-0b40-e183-89b1d65d1aa1', 'DocumentReference/406679b2-a02c-0003-3b17-56ba373fccff') +('406679b2-a02c-0003-3b17-56ba373fccff', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/0734762a-9db6-22fc-b595-c3e472bb2a9a', 'Encounter/2f55edb9-a906-0b40-e183-89b1d65d1aa1', 'DocumentReference/406679b2-a02c-0003-3b17-56ba373fccff') +('41eb62dd-7032-e98d-84c6-d494ad8c877b', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, 'final', None, datetime.date(2018, 7, 31), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/2a0e1946-acf6-5a7e-9399-a9cbc4730199', 'Encounter/aabb3ac3-c4a3-f613-9507-63280adb9209', 'DocumentReference/41eb62dd-7032-e98d-84c6-d494ad8c877b') +('41eb62dd-7032-e98d-84c6-d494ad8c877b', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, 'final', None, datetime.date(2018, 7, 31), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/2a0e1946-acf6-5a7e-9399-a9cbc4730199', 'Encounter/aabb3ac3-c4a3-f613-9507-63280adb9209', 'DocumentReference/41eb62dd-7032-e98d-84c6-d494ad8c877b') +('4390dbd1-3bdf-e516-9fe0-a8180181507f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, 'amended', None, datetime.date(2018, 6, 3), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/e80dda2c-a260-dbf7-3167-bf0945f3a91d', 'Encounter/029d1814-d7bf-0624-524d-7ccda5f320f6', 'DocumentReference/4390dbd1-3bdf-e516-9fe0-a8180181507f') +('4390dbd1-3bdf-e516-9fe0-a8180181507f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, 'amended', None, datetime.date(2018, 6, 3), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/e80dda2c-a260-dbf7-3167-bf0945f3a91d', 'Encounter/029d1814-d7bf-0624-524d-7ccda5f320f6', 'DocumentReference/4390dbd1-3bdf-e516-9fe0-a8180181507f') +('4390dbd1-3bdf-e516-9fe0-a8180181507f-error', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, 'entered-in-error', None, datetime.date(2018, 6, 3), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/e80dda2c-a260-dbf7-3167-bf0945f3a91d', 'Encounter/029d1814-d7bf-0624-524d-7ccda5f320f6', 'DocumentReference/4390dbd1-3bdf-e516-9fe0-a8180181507f-error') +('4390dbd1-3bdf-e516-9fe0-a8180181507f-error', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, 'entered-in-error', None, datetime.date(2018, 6, 3), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/e80dda2c-a260-dbf7-3167-bf0945f3a91d', 'Encounter/029d1814-d7bf-0624-524d-7ccda5f320f6', 'DocumentReference/4390dbd1-3bdf-e516-9fe0-a8180181507f-error') +('4439aa6e-fbc2-21a1-208e-095907104a65', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 30), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/82b8a670-4700-30e8-24a0-b83efa3c5e0a', 'Encounter/75b68644-535d-bdc1-4c31-aa9fe7e1822f', 'DocumentReference/4439aa6e-fbc2-21a1-208e-095907104a65') +('4439aa6e-fbc2-21a1-208e-095907104a65', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 30), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/82b8a670-4700-30e8-24a0-b83efa3c5e0a', 'Encounter/75b68644-535d-bdc1-4c31-aa9fe7e1822f', 'DocumentReference/4439aa6e-fbc2-21a1-208e-095907104a65') +('45160ef5-42e8-7239-6633-904308273198', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/3627adb8-f741-acf3-2dd6-10f3bcbe1077', 'Encounter/bca7cabc-b2fc-8a08-c69b-5bc0afa20d80', 'DocumentReference/45160ef5-42e8-7239-6633-904308273198') +('45160ef5-42e8-7239-6633-904308273198', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/3627adb8-f741-acf3-2dd6-10f3bcbe1077', 'Encounter/bca7cabc-b2fc-8a08-c69b-5bc0afa20d80', 'DocumentReference/45160ef5-42e8-7239-6633-904308273198') +('4711ca43-989d-a8f9-5f32-0102640804cf', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/d3c0274f-f42b-8d2b-15f2-82331e723383', 'Encounter/6565ef5c-30b9-8697-6ca6-2b77894d5437', 'DocumentReference/4711ca43-989d-a8f9-5f32-0102640804cf') +('4711ca43-989d-a8f9-5f32-0102640804cf', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/d3c0274f-f42b-8d2b-15f2-82331e723383', 'Encounter/6565ef5c-30b9-8697-6ca6-2b77894d5437', 'DocumentReference/4711ca43-989d-a8f9-5f32-0102640804cf') +('48693636-4eec-ad3d-b71d-8f650bd0a6f1', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/c7ad408d-fcae-b54a-eb1d-26d48f7a5f84', 'Encounter/02eb4e14-1a6f-d968-2c26-c0cf5023afe0', 'DocumentReference/48693636-4eec-ad3d-b71d-8f650bd0a6f1') +('48693636-4eec-ad3d-b71d-8f650bd0a6f1', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/c7ad408d-fcae-b54a-eb1d-26d48f7a5f84', 'Encounter/02eb4e14-1a6f-d968-2c26-c0cf5023afe0', 'DocumentReference/48693636-4eec-ad3d-b71d-8f650bd0a6f1') +('48933dd8-3fcf-416e-89ca-27851e45391f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 29), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/7cef0e6f-9aea-4079-dfc6-18a96454708e', 'Encounter/d735c414-9dd3-c9b1-285c-8da79a7fbbdf', 'DocumentReference/48933dd8-3fcf-416e-89ca-27851e45391f') +('48933dd8-3fcf-416e-89ca-27851e45391f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 29), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/7cef0e6f-9aea-4079-dfc6-18a96454708e', 'Encounter/d735c414-9dd3-c9b1-285c-8da79a7fbbdf', 'DocumentReference/48933dd8-3fcf-416e-89ca-27851e45391f') +('4b2e99d5-d4c2-fd1f-a5fd-96fe9546b58a', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/6385ddd7-2639-6505-3789-0521b8f66c8b', 'Encounter/fd0754a4-e96d-cba7-b3c0-77697a09c86e', 'DocumentReference/4b2e99d5-d4c2-fd1f-a5fd-96fe9546b58a') +('4b2e99d5-d4c2-fd1f-a5fd-96fe9546b58a', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/6385ddd7-2639-6505-3789-0521b8f66c8b', 'Encounter/fd0754a4-e96d-cba7-b3c0-77697a09c86e', 'DocumentReference/4b2e99d5-d4c2-fd1f-a5fd-96fe9546b58a') +('99b390f4-1bcb-21ec-85d5-85cbb74e86ae', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/9eaa056b-1efc-0cc8-70ff-62c8f704cc13', 'Encounter/5c994000-aa78-2be5-e6cf-99f230d50c2f', 'DocumentReference/99b390f4-1bcb-21ec-85d5-85cbb74e86ae') +('99b390f4-1bcb-21ec-85d5-85cbb74e86ae', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/9eaa056b-1efc-0cc8-70ff-62c8f704cc13', 'Encounter/5c994000-aa78-2be5-e6cf-99f230d50c2f', 'DocumentReference/99b390f4-1bcb-21ec-85d5-85cbb74e86ae') +('99d49a34-c515-23a1-c3e4-ef73c3cef727', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 26), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/cc9fb8e2-fe52-b72a-aebb-9d10260f121b', 'Encounter/683b04eb-663a-849f-715f-4ccd70bf1524', 'DocumentReference/99d49a34-c515-23a1-c3e4-ef73c3cef727') +('99d49a34-c515-23a1-c3e4-ef73c3cef727', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 26), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/cc9fb8e2-fe52-b72a-aebb-9d10260f121b', 'Encounter/683b04eb-663a-849f-715f-4ccd70bf1524', 'DocumentReference/99d49a34-c515-23a1-c3e4-ef73c3cef727') +('99e26f8b-a5a2-ad5e-713a-16266b5991a1', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/1c498b42-61fd-6341-69c3-053f6e4fe404', 'Encounter/e613f29d-7505-6f2e-a1f5-bfbec300752d', 'DocumentReference/99e26f8b-a5a2-ad5e-713a-16266b5991a1') +('99e26f8b-a5a2-ad5e-713a-16266b5991a1', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/1c498b42-61fd-6341-69c3-053f6e4fe404', 'Encounter/e613f29d-7505-6f2e-a1f5-bfbec300752d', 'DocumentReference/99e26f8b-a5a2-ad5e-713a-16266b5991a1') +('9a50a40a-8099-5ab5-0903-1ba65d8c0905', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/24906e2c-e556-71dc-23d9-3e1d5fb08986', 'Encounter/1154d05c-8727-9373-4224-25b9fdba9ab3', 'DocumentReference/9a50a40a-8099-5ab5-0903-1ba65d8c0905') +('9a50a40a-8099-5ab5-0903-1ba65d8c0905', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/24906e2c-e556-71dc-23d9-3e1d5fb08986', 'Encounter/1154d05c-8727-9373-4224-25b9fdba9ab3', 'DocumentReference/9a50a40a-8099-5ab5-0903-1ba65d8c0905') +('9ca118c6-e354-5588-3cdc-77ee3b3c8711', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/2da1bee2-2bc2-4511-84e1-42860310e2fb', 'Encounter/d5f342b7-017c-f2e7-8697-5a038c91518e', 'DocumentReference/9ca118c6-e354-5588-3cdc-77ee3b3c8711') +('9ca118c6-e354-5588-3cdc-77ee3b3c8711', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/2da1bee2-2bc2-4511-84e1-42860310e2fb', 'Encounter/d5f342b7-017c-f2e7-8697-5a038c91518e', 'DocumentReference/9ca118c6-e354-5588-3cdc-77ee3b3c8711') +('a1b69e45-11f8-a49f-170e-32004c70e842', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 11), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/5ce2e599-fb6e-9b4d-3c2e-87310619b957', 'Encounter/4b03a408-6694-88e3-0e63-3ee464ecd6cd', 'DocumentReference/a1b69e45-11f8-a49f-170e-32004c70e842') +('a1b69e45-11f8-a49f-170e-32004c70e842', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 11), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/5ce2e599-fb6e-9b4d-3c2e-87310619b957', 'Encounter/4b03a408-6694-88e3-0e63-3ee464ecd6cd', 'DocumentReference/a1b69e45-11f8-a49f-170e-32004c70e842') +('a3964c82-0605-c2b2-97dc-0de17a1ec0ef', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 17), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/7f941bcc-e7b2-99e1-585f-129d0ef1c13d', 'Encounter/65f8fdca-a949-80a0-8072-094e9aaee474', 'DocumentReference/a3964c82-0605-c2b2-97dc-0de17a1ec0ef') +('a3964c82-0605-c2b2-97dc-0de17a1ec0ef', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 17), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/7f941bcc-e7b2-99e1-585f-129d0ef1c13d', 'Encounter/65f8fdca-a949-80a0-8072-094e9aaee474', 'DocumentReference/a3964c82-0605-c2b2-97dc-0de17a1ec0ef') +('a5231f35-ad14-580e-1888-55c1b383aa11', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/3ae095ec-8fe0-133b-36d4-8785a6ad8df3', 'Encounter/75312bd2-d5ac-c62e-c9df-0004783725c7', 'DocumentReference/a5231f35-ad14-580e-1888-55c1b383aa11') +('a5231f35-ad14-580e-1888-55c1b383aa11', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/3ae095ec-8fe0-133b-36d4-8785a6ad8df3', 'Encounter/75312bd2-d5ac-c62e-c9df-0004783725c7', 'DocumentReference/a5231f35-ad14-580e-1888-55c1b383aa11') +('a59ca653-b95d-09d2-9fa5-a1b492d85a5f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 28), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/c20e5afd-30df-ac3d-6684-cc29438a9bc4', 'Encounter/b864bcd8-14e0-8bec-b7cc-f8629d91470e', 'DocumentReference/a59ca653-b95d-09d2-9fa5-a1b492d85a5f') +('a59ca653-b95d-09d2-9fa5-a1b492d85a5f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 28), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/c20e5afd-30df-ac3d-6684-cc29438a9bc4', 'Encounter/b864bcd8-14e0-8bec-b7cc-f8629d91470e', 'DocumentReference/a59ca653-b95d-09d2-9fa5-a1b492d85a5f') +('a69150c5-2fbe-2284-1eb5-e11146858a22', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 1), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/9c8d8539-0b1e-73e2-b64f-83f1ea601fa4', 'Encounter/f2752dd7-1bf1-739d-dd8c-40122d0b63bc', 'DocumentReference/a69150c5-2fbe-2284-1eb5-e11146858a22') +('a69150c5-2fbe-2284-1eb5-e11146858a22', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 1), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/9c8d8539-0b1e-73e2-b64f-83f1ea601fa4', 'Encounter/f2752dd7-1bf1-739d-dd8c-40122d0b63bc', 'DocumentReference/a69150c5-2fbe-2284-1eb5-e11146858a22') +('a7115116-f8da-3960-e3ed-f1f0d89646c3', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 2), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/8877ef1f-7cd7-3242-d7f0-73cf3f7165f4', 'Encounter/299b6495-3fe7-8db3-c494-6e1ce8b7986d', 'DocumentReference/a7115116-f8da-3960-e3ed-f1f0d89646c3') +('a7115116-f8da-3960-e3ed-f1f0d89646c3', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 2), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/8877ef1f-7cd7-3242-d7f0-73cf3f7165f4', 'Encounter/299b6495-3fe7-8db3-c494-6e1ce8b7986d', 'DocumentReference/a7115116-f8da-3960-e3ed-f1f0d89646c3') +('a79da4dd-83bc-5b6a-db34-bd35b3acbd2c', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 6), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/19158de4-66a2-f70f-e3bf-4396b312c8f1', 'Encounter/ed151e04-3dd6-8cb7-a3e5-777c8a8667f1', 'DocumentReference/a79da4dd-83bc-5b6a-db34-bd35b3acbd2c') +('a79da4dd-83bc-5b6a-db34-bd35b3acbd2c', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 6), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/19158de4-66a2-f70f-e3bf-4396b312c8f1', 'Encounter/ed151e04-3dd6-8cb7-a3e5-777c8a8667f1', 'DocumentReference/a79da4dd-83bc-5b6a-db34-bd35b3acbd2c') +('a95df5ea-7005-9e98-e97a-1ade6967b585', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 16), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/16be855b-ece2-8b96-1ef9-a4d93adf3289', 'Encounter/83d0d564-3bbf-48eb-7445-bd2b81130671', 'DocumentReference/a95df5ea-7005-9e98-e97a-1ade6967b585') +('a95df5ea-7005-9e98-e97a-1ade6967b585', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 16), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/16be855b-ece2-8b96-1ef9-a4d93adf3289', 'Encounter/83d0d564-3bbf-48eb-7445-bd2b81130671', 'DocumentReference/a95df5ea-7005-9e98-e97a-1ade6967b585') +('a96ba3b7-a461-5849-1881-d372e0460ccc', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 14), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/26a3984f-b2a8-e67f-7abc-ff147a0e6e35', 'Encounter/79d8f213-7847-646b-8a66-5da208cc1c27', 'DocumentReference/a96ba3b7-a461-5849-1881-d372e0460ccc') +('a96ba3b7-a461-5849-1881-d372e0460ccc', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 14), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/26a3984f-b2a8-e67f-7abc-ff147a0e6e35', 'Encounter/79d8f213-7847-646b-8a66-5da208cc1c27', 'DocumentReference/a96ba3b7-a461-5849-1881-d372e0460ccc') +('ac0439bc-e450-d339-da6d-5ead96d8b346', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 30), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/2858705f-5af1-9869-4d94-894e09a9f99a', 'Encounter/de9d67de-6ae3-32f7-20f2-e719ae23a9a3', 'DocumentReference/ac0439bc-e450-d339-da6d-5ead96d8b346') +('ac0439bc-e450-d339-da6d-5ead96d8b346', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 30), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/2858705f-5af1-9869-4d94-894e09a9f99a', 'Encounter/de9d67de-6ae3-32f7-20f2-e719ae23a9a3', 'DocumentReference/ac0439bc-e450-d339-da6d-5ead96d8b346') +('ad2bee76-6e59-5d8b-21ed-b30cdb784198', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 9), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/e455ca3f-fc16-6ffc-297a-adc27e2db183', 'Encounter/98d4bd14-d78e-debb-e7dc-2df7786aedf3', 'DocumentReference/ad2bee76-6e59-5d8b-21ed-b30cdb784198') +('ad2bee76-6e59-5d8b-21ed-b30cdb784198', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 9), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/e455ca3f-fc16-6ffc-297a-adc27e2db183', 'Encounter/98d4bd14-d78e-debb-e7dc-2df7786aedf3', 'DocumentReference/ad2bee76-6e59-5d8b-21ed-b30cdb784198') +('b1f5c114-8e28-08c0-0193-0855aa10c97f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/c7c5c028-f1fb-962b-8db2-dfd4c6d6b02a', 'Encounter/aa890974-162f-5906-dc71-2bb6d2185314', 'DocumentReference/b1f5c114-8e28-08c0-0193-0855aa10c97f') +('b1f5c114-8e28-08c0-0193-0855aa10c97f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/c7c5c028-f1fb-962b-8db2-dfd4c6d6b02a', 'Encounter/aa890974-162f-5906-dc71-2bb6d2185314', 'DocumentReference/b1f5c114-8e28-08c0-0193-0855aa10c97f') +('b2896621-57ef-1ad3-91c5-389dce96973b', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 7), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/ac91b90d-97e4-4fc5-41cd-036bac49e6e8', 'Encounter/dc5ed645-3979-e765-3e03-6ba2173027c3', 'DocumentReference/b2896621-57ef-1ad3-91c5-389dce96973b') +('b2896621-57ef-1ad3-91c5-389dce96973b', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 7), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/ac91b90d-97e4-4fc5-41cd-036bac49e6e8', 'Encounter/dc5ed645-3979-e765-3e03-6ba2173027c3', 'DocumentReference/b2896621-57ef-1ad3-91c5-389dce96973b') +('b3357397-9f4c-7d00-06af-18f03c63d583', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/c1bfec36-dc2c-afc8-c767-3d35ed2bf6f0', 'Encounter/8ff1dc01-5a28-b2d8-3b42-4b7a7d539970', 'DocumentReference/b3357397-9f4c-7d00-06af-18f03c63d583') +('b3357397-9f4c-7d00-06af-18f03c63d583', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/c1bfec36-dc2c-afc8-c767-3d35ed2bf6f0', 'Encounter/8ff1dc01-5a28-b2d8-3b42-4b7a7d539970', 'DocumentReference/b3357397-9f4c-7d00-06af-18f03c63d583') +('b339c2e8-35eb-1838-7eea-5a04c81695df', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/267fc42d-cd9e-8527-1f9e-887fe7776147', 'Encounter/4c4d0730-201f-5b75-c657-8d0de09cc28f', 'DocumentReference/b339c2e8-35eb-1838-7eea-5a04c81695df') +('b339c2e8-35eb-1838-7eea-5a04c81695df', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/267fc42d-cd9e-8527-1f9e-887fe7776147', 'Encounter/4c4d0730-201f-5b75-c657-8d0de09cc28f', 'DocumentReference/b339c2e8-35eb-1838-7eea-5a04c81695df') +('b39532e8-ee15-a7c4-cac5-353a8be67d15', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 8), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/6a883108-7b87-120b-d163-d369336e04e5', 'Encounter/2b1ee164-6c87-420d-a9e2-6c235ebeef71', 'DocumentReference/b39532e8-ee15-a7c4-cac5-353a8be67d15') +('b39532e8-ee15-a7c4-cac5-353a8be67d15', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 8), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/6a883108-7b87-120b-d163-d369336e04e5', 'Encounter/2b1ee164-6c87-420d-a9e2-6c235ebeef71', 'DocumentReference/b39532e8-ee15-a7c4-cac5-353a8be67d15') +('b44d277c-7c09-a39b-97e9-1e96d71b6978', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/7bf52d54-0d2a-265a-15aa-eeed7aaf4af6', 'Encounter/ba84689e-2f9f-7cea-af1f-d69ffdd3a3eb', 'DocumentReference/b44d277c-7c09-a39b-97e9-1e96d71b6978') +('b44d277c-7c09-a39b-97e9-1e96d71b6978', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/7bf52d54-0d2a-265a-15aa-eeed7aaf4af6', 'Encounter/ba84689e-2f9f-7cea-af1f-d69ffdd3a3eb', 'DocumentReference/b44d277c-7c09-a39b-97e9-1e96d71b6978') +('b58f7768-64be-6c0f-1b82-3deffdef1076', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/a28be3e1-a6bd-7df4-fc81-1140848f8453', 'Encounter/91f94a9d-69a7-e30a-cd1a-68c52dc01e70', 'DocumentReference/b58f7768-64be-6c0f-1b82-3deffdef1076') +('b58f7768-64be-6c0f-1b82-3deffdef1076', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/a28be3e1-a6bd-7df4-fc81-1140848f8453', 'Encounter/91f94a9d-69a7-e30a-cd1a-68c52dc01e70', 'DocumentReference/b58f7768-64be-6c0f-1b82-3deffdef1076') +('b73493d0-e2f4-9aa6-cdad-920f7c126d6c', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 16), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/50f8b42e-17a6-e932-8546-da94004c597c', 'Encounter/37604257-be1a-120f-81ee-336f81603f92', 'DocumentReference/b73493d0-e2f4-9aa6-cdad-920f7c126d6c') +('b73493d0-e2f4-9aa6-cdad-920f7c126d6c', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 16), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/50f8b42e-17a6-e932-8546-da94004c597c', 'Encounter/37604257-be1a-120f-81ee-336f81603f92', 'DocumentReference/b73493d0-e2f4-9aa6-cdad-920f7c126d6c') +('b7b68006-53d5-b823-d193-56b262f45e8b', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/ad3ed58a-5645-af0a-eeca-ab543123a8aa', 'Encounter/03e34b19-2889-b828-792d-2a83400c55be', 'DocumentReference/b7b68006-53d5-b823-d193-56b262f45e8b') +('b7b68006-53d5-b823-d193-56b262f45e8b', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/ad3ed58a-5645-af0a-eeca-ab543123a8aa', 'Encounter/03e34b19-2889-b828-792d-2a83400c55be', 'DocumentReference/b7b68006-53d5-b823-d193-56b262f45e8b') +('b953a85f-f18b-d7a3-8974-ba44e0a3141c', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 5), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/a5bc08ea-9462-c4f5-1bd2-ff342598ac99', 'Encounter/f964be66-3fcd-95c8-0021-71c7d24c91b7', 'DocumentReference/b953a85f-f18b-d7a3-8974-ba44e0a3141c') +('b953a85f-f18b-d7a3-8974-ba44e0a3141c', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 5), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/a5bc08ea-9462-c4f5-1bd2-ff342598ac99', 'Encounter/f964be66-3fcd-95c8-0021-71c7d24c91b7', 'DocumentReference/b953a85f-f18b-d7a3-8974-ba44e0a3141c') +('b985a70c-9504-b7b3-0707-f8381ba77976', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/149de67a-2809-59a8-bfa2-36df509021dc', 'Encounter/beb26500-4ccd-ce0a-44f6-74f44be5fafe', 'DocumentReference/b985a70c-9504-b7b3-0707-f8381ba77976') +('b985a70c-9504-b7b3-0707-f8381ba77976', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/149de67a-2809-59a8-bfa2-36df509021dc', 'Encounter/beb26500-4ccd-ce0a-44f6-74f44be5fafe', 'DocumentReference/b985a70c-9504-b7b3-0707-f8381ba77976') +('ba0abbd6-49a9-95fa-2396-7118c56da8c6', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 12), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/9b17654f-a902-3d56-9000-4ade3dd3059f', 'Encounter/ca45bbef-ef2a-3b3c-ea5e-76bcd5865780', 'DocumentReference/ba0abbd6-49a9-95fa-2396-7118c56da8c6') +('ba0abbd6-49a9-95fa-2396-7118c56da8c6', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 12), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/9b17654f-a902-3d56-9000-4ade3dd3059f', 'Encounter/ca45bbef-ef2a-3b3c-ea5e-76bcd5865780', 'DocumentReference/ba0abbd6-49a9-95fa-2396-7118c56da8c6') +('bcbaa9d3-d7cf-3f5f-44d3-32c8a267f991', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/17fde357-dcc9-af8b-a8d3-4bd213afeb22', 'Encounter/32d0ae2d-1be8-9e90-a4da-4c222abd88a9', 'DocumentReference/bcbaa9d3-d7cf-3f5f-44d3-32c8a267f991') +('bcbaa9d3-d7cf-3f5f-44d3-32c8a267f991', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/17fde357-dcc9-af8b-a8d3-4bd213afeb22', 'Encounter/32d0ae2d-1be8-9e90-a4da-4c222abd88a9', 'DocumentReference/bcbaa9d3-d7cf-3f5f-44d3-32c8a267f991') +('bd60a52b-65b9-f26d-03e4-282850509f03', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/51032f44-d514-26e9-3e85-e956561c076e', 'Encounter/d73ed087-e0ae-78e0-7a05-1bac1060c476', 'DocumentReference/bd60a52b-65b9-f26d-03e4-282850509f03') +('bd60a52b-65b9-f26d-03e4-282850509f03', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/51032f44-d514-26e9-3e85-e956561c076e', 'Encounter/d73ed087-e0ae-78e0-7a05-1bac1060c476', 'DocumentReference/bd60a52b-65b9-f26d-03e4-282850509f03') +('bfddb0ff-1296-107e-76ca-14b4a14db9ce', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/26baae20-c8c5-003a-ab6b-ebcc49be20db', 'Encounter/c6ec2350-43d4-abab-2e84-4d2aadb337a7', 'DocumentReference/bfddb0ff-1296-107e-76ca-14b4a14db9ce') +('bfddb0ff-1296-107e-76ca-14b4a14db9ce', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/26baae20-c8c5-003a-ab6b-ebcc49be20db', 'Encounter/c6ec2350-43d4-abab-2e84-4d2aadb337a7', 'DocumentReference/bfddb0ff-1296-107e-76ca-14b4a14db9ce') +('c18dbe84-be31-cee5-1f2e-cf163cdd3e3f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 27), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/a5b171a7-9b28-20e7-86a7-936ecbf55f36', 'Encounter/c4605953-3103-ede6-e0c0-e0588e6f019e', 'DocumentReference/c18dbe84-be31-cee5-1f2e-cf163cdd3e3f') +('c18dbe84-be31-cee5-1f2e-cf163cdd3e3f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 27), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/a5b171a7-9b28-20e7-86a7-936ecbf55f36', 'Encounter/c4605953-3103-ede6-e0c0-e0588e6f019e', 'DocumentReference/c18dbe84-be31-cee5-1f2e-cf163cdd3e3f') +('c6598486-8276-b44a-286e-b376143f7efc', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 25), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/47c37c92-5932-9cfe-66be-208556780fe0', 'Encounter/b5974881-ae62-ddd6-b905-8c86c1ca9e33', 'DocumentReference/c6598486-8276-b44a-286e-b376143f7efc') +('c6598486-8276-b44a-286e-b376143f7efc', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 25), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/47c37c92-5932-9cfe-66be-208556780fe0', 'Encounter/b5974881-ae62-ddd6-b905-8c86c1ca9e33', 'DocumentReference/c6598486-8276-b44a-286e-b376143f7efc') +('c6c64129-9dfa-840d-3309-a5590cc74f2e', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/ad239efc-637c-e428-c829-b87e700d5446', 'Encounter/366df7d3-2ea9-db22-7cdd-60fa8a5c45ca', 'DocumentReference/c6c64129-9dfa-840d-3309-a5590cc74f2e') +('c6c64129-9dfa-840d-3309-a5590cc74f2e', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/ad239efc-637c-e428-c829-b87e700d5446', 'Encounter/366df7d3-2ea9-db22-7cdd-60fa8a5c45ca', 'DocumentReference/c6c64129-9dfa-840d-3309-a5590cc74f2e') +('c84e67e9-4ea8-700b-9f2b-c0179e803d4f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/dffa62dc-8ec2-1cd6-ee75-f9156a5283fe', 'Encounter/11381dc6-0e06-da55-0735-d1e7bbf8bb35', 'DocumentReference/c84e67e9-4ea8-700b-9f2b-c0179e803d4f') +('c84e67e9-4ea8-700b-9f2b-c0179e803d4f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/dffa62dc-8ec2-1cd6-ee75-f9156a5283fe', 'Encounter/11381dc6-0e06-da55-0735-d1e7bbf8bb35', 'DocumentReference/c84e67e9-4ea8-700b-9f2b-c0179e803d4f') diff --git a/tests/test_data/core/core__encounter.txt b/tests/test_data/core/core__encounter.txt index 3d1ecb30..eacd26c7 100644 --- a/tests/test_data/core/core__encounter.txt +++ b/tests/test_data/core/core__encounter.txt @@ -8,43 +8,43 @@ ('2b1ee164-6c87-420d-a9e2-6c235ebeef71', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 15, datetime.date(2018, 6, 8), datetime.date(2018, 6, 8), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/6a883108-7b87-120b-d163-d369336e04e5', 'Encounter/2b1ee164-6c87-420d-a9e2-6c235ebeef71', 'male', 'white', 'not hispanic or latino', '672') ('2f55edb9-a906-0b40-e183-89b1d65d1aa1', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 16, datetime.date(2018, 7, 21), datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/0734762a-9db6-22fc-b595-c3e472bb2a9a', 'Encounter/2f55edb9-a906-0b40-e183-89b1d65d1aa1', 'female', 'white', 'not hispanic or latino', '672') ('32d0ae2d-1be8-9e90-a4da-4c222abd88a9', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 72, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/17fde357-dcc9-af8b-a8d3-4bd213afeb22', 'Encounter/32d0ae2d-1be8-9e90-a4da-4c222abd88a9', 'male', 'white', 'not hispanic or latino', '662') -('366df7d3-2ea9-db22-7cdd-60fa8a5c45ca', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, '431857002', 'http://snomed.info/sct', None, None, 66, datetime.date(2018, 6, 15), datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/ad239efc-637c-e428-c829-b87e700d5446', 'Encounter/366df7d3-2ea9-db22-7cdd-60fa8a5c45ca', 'male', 'black or african american', 'not hispanic or latino', '678') -('37604257-be1a-120f-81ee-336f81603f92', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, '431857002', 'http://snomed.info/sct', None, None, 48, datetime.date(2018, 7, 16), datetime.date(2018, 7, 16), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/50f8b42e-17a6-e932-8546-da94004c597c', 'Encounter/37604257-be1a-120f-81ee-336f81603f92', 'male', 'white', 'not hispanic or latino', '666') +('366df7d3-2ea9-db22-7cdd-60fa8a5c45ca', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 66, datetime.date(2018, 6, 15), datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/ad239efc-637c-e428-c829-b87e700d5446', 'Encounter/366df7d3-2ea9-db22-7cdd-60fa8a5c45ca', 'male', 'black or african american', 'not hispanic or latino', '678') +('37604257-be1a-120f-81ee-336f81603f92', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 48, datetime.date(2018, 7, 16), datetime.date(2018, 7, 16), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/50f8b42e-17a6-e932-8546-da94004c597c', 'Encounter/37604257-be1a-120f-81ee-336f81603f92', 'male', 'white', 'not hispanic or latino', '666') ('4b03a408-6694-88e3-0e63-3ee464ecd6cd', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 73, datetime.date(2018, 7, 11), datetime.date(2018, 7, 11), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/5ce2e599-fb6e-9b4d-3c2e-87310619b957', 'Encounter/4b03a408-6694-88e3-0e63-3ee464ecd6cd', 'male', 'white', 'not hispanic or latino', '660') ('4c4d0730-201f-5b75-c657-8d0de09cc28f', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 60, datetime.date(2018, 6, 14), datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/267fc42d-cd9e-8527-1f9e-887fe7776147', 'Encounter/4c4d0730-201f-5b75-c657-8d0de09cc28f', 'female', 'white', 'not hispanic or latino', '676') ('5c3450fb-12f0-08f3-6e4d-8a5e433e19a4', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 46, datetime.date(2018, 6, 21), datetime.date(2018, 6, 21), datetime.date(2018, 6, 18), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/a46846ca-3f95-2cbb-3a9d-5eae150a0273', 'Encounter/5c3450fb-12f0-08f3-6e4d-8a5e433e19a4', 'female', 'white', 'not hispanic or latino', '660') ('5c994000-aa78-2be5-e6cf-99f230d50c2f', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 81, datetime.date(2018, 7, 13), datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/9eaa056b-1efc-0cc8-70ff-62c8f704cc13', 'Encounter/5c994000-aa78-2be5-e6cf-99f230d50c2f', 'male', 'white', 'not hispanic or latino', '672') ('6565ef5c-30b9-8697-6ca6-2b77894d5437', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 19, datetime.date(2018, 7, 19), datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/d3c0274f-f42b-8d2b-15f2-82331e723383', 'Encounter/6565ef5c-30b9-8697-6ca6-2b77894d5437', 'female', 'white', 'not hispanic or latino', '668') -('65f8fdca-a949-80a0-8072-094e9aaee474', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, '10509002', 'http://snomed.info/sct', None, None, 9, datetime.date(2018, 6, 17), datetime.date(2018, 6, 17), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/7f941bcc-e7b2-99e1-585f-129d0ef1c13d', 'Encounter/65f8fdca-a949-80a0-8072-094e9aaee474', 'female', 'white', 'not hispanic or latino', '674') +('65f8fdca-a949-80a0-8072-094e9aaee474', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 9, datetime.date(2018, 6, 17), datetime.date(2018, 6, 17), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/7f941bcc-e7b2-99e1-585f-129d0ef1c13d', 'Encounter/65f8fdca-a949-80a0-8072-094e9aaee474', 'female', 'white', 'not hispanic or latino', '674') ('683b04eb-663a-849f-715f-4ccd70bf1524', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 12, datetime.date(2018, 7, 26), datetime.date(2018, 7, 26), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/cc9fb8e2-fe52-b72a-aebb-9d10260f121b', 'Encounter/683b04eb-663a-849f-715f-4ccd70bf1524', 'female', 'white', 'not hispanic or latino', '660') -('6a952afd-3be5-e27e-9e05-5a1e085e34d0', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, '444814009', 'http://snomed.info/sct', None, None, 16, datetime.date(2018, 7, 21), datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/f9399f0d-5401-09f3-d4ff-89b1aa51b9c8', 'Encounter/6a952afd-3be5-e27e-9e05-5a1e085e34d0', 'male', 'white', 'not hispanic or latino', '674') +('6a952afd-3be5-e27e-9e05-5a1e085e34d0', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 16, datetime.date(2018, 7, 21), datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/f9399f0d-5401-09f3-d4ff-89b1aa51b9c8', 'Encounter/6a952afd-3be5-e27e-9e05-5a1e085e34d0', 'male', 'white', 'not hispanic or latino', '674') ('75312bd2-d5ac-c62e-c9df-0004783725c7', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 11, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/3ae095ec-8fe0-133b-36d4-8785a6ad8df3', 'Encounter/75312bd2-d5ac-c62e-c9df-0004783725c7', 'female', 'white', 'not hispanic or latino', '662') -('75b68644-535d-bdc1-4c31-aa9fe7e1822f', 'finished', 'EMER', 'emergency', None, None, None, None, None, None, '55680006', 'http://snomed.info/sct', None, None, 25, datetime.date(2018, 6, 30), datetime.date(2018, 6, 30), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/82b8a670-4700-30e8-24a0-b83efa3c5e0a', 'Encounter/75b68644-535d-bdc1-4c31-aa9fe7e1822f', 'female', 'white', 'not hispanic or latino', '672') -('79d8f213-7847-646b-8a66-5da208cc1c27', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, '431857002', 'http://snomed.info/sct', None, None, 77, datetime.date(2018, 7, 14), datetime.date(2018, 7, 14), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/26a3984f-b2a8-e67f-7abc-ff147a0e6e35', 'Encounter/79d8f213-7847-646b-8a66-5da208cc1c27', 'male', 'white', 'not hispanic or latino', '674') -('83d0d564-3bbf-48eb-7445-bd2b81130671', 'finished', 'EMER', 'emergency', None, None, None, None, None, None, '55680006', 'http://snomed.info/sct', None, None, 69, datetime.date(2018, 6, 16), datetime.date(2018, 6, 17), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/16be855b-ece2-8b96-1ef9-a4d93adf3289', 'Encounter/83d0d564-3bbf-48eb-7445-bd2b81130671', 'male', 'white', 'not hispanic or latino', '660') +('75b68644-535d-bdc1-4c31-aa9fe7e1822f', 'finished', 'EMER', 'emergency', None, None, None, None, None, None, None, None, None, None, 25, datetime.date(2018, 6, 30), datetime.date(2018, 6, 30), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/82b8a670-4700-30e8-24a0-b83efa3c5e0a', 'Encounter/75b68644-535d-bdc1-4c31-aa9fe7e1822f', 'female', 'white', 'not hispanic or latino', '672') +('79d8f213-7847-646b-8a66-5da208cc1c27', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 77, datetime.date(2018, 7, 14), datetime.date(2018, 7, 14), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/26a3984f-b2a8-e67f-7abc-ff147a0e6e35', 'Encounter/79d8f213-7847-646b-8a66-5da208cc1c27', 'male', 'white', 'not hispanic or latino', '674') +('83d0d564-3bbf-48eb-7445-bd2b81130671', 'finished', 'EMER', 'emergency', None, None, None, None, None, None, None, None, None, None, 69, datetime.date(2018, 6, 16), datetime.date(2018, 6, 17), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/16be855b-ece2-8b96-1ef9-a4d93adf3289', 'Encounter/83d0d564-3bbf-48eb-7445-bd2b81130671', 'male', 'white', 'not hispanic or latino', '660') ('8ff1dc01-5a28-b2d8-3b42-4b7a7d539970', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 55, datetime.date(2018, 7, 15), datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/c1bfec36-dc2c-afc8-c767-3d35ed2bf6f0', 'Encounter/8ff1dc01-5a28-b2d8-3b42-4b7a7d539970', 'female', 'white', 'not hispanic or latino', '662') ('91f94a9d-69a7-e30a-cd1a-68c52dc01e70', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 22, datetime.date(2018, 6, 29), datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/a28be3e1-a6bd-7df4-fc81-1140848f8453', 'Encounter/91f94a9d-69a7-e30a-cd1a-68c52dc01e70', 'female', 'white', 'not hispanic or latino', '662') ('98d4bd14-d78e-debb-e7dc-2df7786aedf3', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 89, datetime.date(2018, 7, 9), datetime.date(2018, 7, 9), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/e455ca3f-fc16-6ffc-297a-adc27e2db183', 'Encounter/98d4bd14-d78e-debb-e7dc-2df7786aedf3', 'male', 'white', 'hispanic or latino', '667') -('aa890974-162f-5906-dc71-2bb6d2185314', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, '431857002', 'http://snomed.info/sct', None, None, 50, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/c7c5c028-f1fb-962b-8db2-dfd4c6d6b02a', 'Encounter/aa890974-162f-5906-dc71-2bb6d2185314', 'male', 'white', 'not hispanic or latino', '672') +('aa890974-162f-5906-dc71-2bb6d2185314', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 50, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/c7c5c028-f1fb-962b-8db2-dfd4c6d6b02a', 'Encounter/aa890974-162f-5906-dc71-2bb6d2185314', 'male', 'white', 'not hispanic or latino', '672') ('aabb3ac3-c4a3-f613-9507-63280adb9209', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 0, datetime.date(2018, 7, 31), datetime.date(2018, 7, 31), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/2a0e1946-acf6-5a7e-9399-a9cbc4730199', 'Encounter/aabb3ac3-c4a3-f613-9507-63280adb9209', 'female', 'white', 'not hispanic or latino', '675') -('b5974881-ae62-ddd6-b905-8c86c1ca9e33', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, '271737000', 'http://snomed.info/sct', None, None, 41, datetime.date(2018, 6, 25), datetime.date(2018, 6, 25), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/47c37c92-5932-9cfe-66be-208556780fe0', 'Encounter/b5974881-ae62-ddd6-b905-8c86c1ca9e33', 'male', 'white', 'not hispanic or latino', '675') +('b5974881-ae62-ddd6-b905-8c86c1ca9e33', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 41, datetime.date(2018, 6, 25), datetime.date(2018, 6, 25), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/47c37c92-5932-9cfe-66be-208556780fe0', 'Encounter/b5974881-ae62-ddd6-b905-8c86c1ca9e33', 'male', 'white', 'not hispanic or latino', '675') ('b864bcd8-14e0-8bec-b7cc-f8629d91470e', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 15, datetime.date(2018, 6, 28), datetime.date(2018, 6, 28), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/c20e5afd-30df-ac3d-6684-cc29438a9bc4', 'Encounter/b864bcd8-14e0-8bec-b7cc-f8629d91470e', 'female', 'white', 'not hispanic or latino', '662') ('ba84689e-2f9f-7cea-af1f-d69ffdd3a3eb', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 39, datetime.date(2018, 6, 15), datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/7bf52d54-0d2a-265a-15aa-eeed7aaf4af6', 'Encounter/ba84689e-2f9f-7cea-af1f-d69ffdd3a3eb', 'female', 'white', 'not hispanic or latino', '670') -('bca7cabc-b2fc-8a08-c69b-5bc0afa20d80', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, '271737000', 'http://snomed.info/sct', None, None, 28, datetime.date(2018, 7, 13), datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/3627adb8-f741-acf3-2dd6-10f3bcbe1077', 'Encounter/bca7cabc-b2fc-8a08-c69b-5bc0afa20d80', 'female', 'white', 'not hispanic or latino', '674') +('bca7cabc-b2fc-8a08-c69b-5bc0afa20d80', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 28, datetime.date(2018, 7, 13), datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/3627adb8-f741-acf3-2dd6-10f3bcbe1077', 'Encounter/bca7cabc-b2fc-8a08-c69b-5bc0afa20d80', 'female', 'white', 'not hispanic or latino', '674') ('beb26500-4ccd-ce0a-44f6-74f44be5fafe', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 14, datetime.date(2018, 6, 7), datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/149de67a-2809-59a8-bfa2-36df509021dc', 'Encounter/beb26500-4ccd-ce0a-44f6-74f44be5fafe', 'female', 'white', 'not hispanic or latino', '667') ('c4605953-3103-ede6-e0c0-e0588e6f019e', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 61, datetime.date(2018, 7, 27), datetime.date(2018, 7, 27), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/a5b171a7-9b28-20e7-86a7-936ecbf55f36', 'Encounter/c4605953-3103-ede6-e0c0-e0588e6f019e', 'female', 'white', 'not hispanic or latino', '675') ('c6ec2350-43d4-abab-2e84-4d2aadb337a7', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 53, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/26baae20-c8c5-003a-ab6b-ebcc49be20db', 'Encounter/c6ec2350-43d4-abab-2e84-4d2aadb337a7', 'male', 'white', 'not hispanic or latino', '678') -('ca45bbef-ef2a-3b3c-ea5e-76bcd5865780', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, '72892002', 'http://snomed.info/sct', None, None, 48, datetime.date(2018, 6, 12), datetime.date(2018, 6, 12), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/9b17654f-a902-3d56-9000-4ade3dd3059f', 'Encounter/ca45bbef-ef2a-3b3c-ea5e-76bcd5865780', 'female', 'white', 'hispanic or latino', '672') +('ca45bbef-ef2a-3b3c-ea5e-76bcd5865780', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 48, datetime.date(2018, 6, 12), datetime.date(2018, 6, 12), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/9b17654f-a902-3d56-9000-4ade3dd3059f', 'Encounter/ca45bbef-ef2a-3b3c-ea5e-76bcd5865780', 'female', 'white', 'hispanic or latino', '672') ('d2782687-6885-037c-957d-579fbd681d2a', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 54, datetime.date(2018, 6, 13), datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/3cf7af45-2bee-aa9c-d524-40b487149d60', 'Encounter/d2782687-6885-037c-957d-579fbd681d2a', 'male', 'white', 'not hispanic or latino', '000') -('d5f342b7-017c-f2e7-8697-5a038c91518e', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, '72892002', 'http://snomed.info/sct', None, None, 20, datetime.date(2018, 7, 28), datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/2da1bee2-2bc2-4511-84e1-42860310e2fb', 'Encounter/d5f342b7-017c-f2e7-8697-5a038c91518e', 'female', 'white', 'not hispanic or latino', '660') -('d735c414-9dd3-c9b1-285c-8da79a7fbbdf', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, '431857002', 'http://snomed.info/sct', None, None, 61, datetime.date(2018, 7, 29), datetime.date(2018, 7, 29), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/7cef0e6f-9aea-4079-dfc6-18a96454708e', 'Encounter/d735c414-9dd3-c9b1-285c-8da79a7fbbdf', 'female', 'white', 'not hispanic or latino', '662') +('d5f342b7-017c-f2e7-8697-5a038c91518e', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 20, datetime.date(2018, 7, 28), datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/2da1bee2-2bc2-4511-84e1-42860310e2fb', 'Encounter/d5f342b7-017c-f2e7-8697-5a038c91518e', 'female', 'white', 'not hispanic or latino', '660') +('d735c414-9dd3-c9b1-285c-8da79a7fbbdf', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 61, datetime.date(2018, 7, 29), datetime.date(2018, 7, 29), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/7cef0e6f-9aea-4079-dfc6-18a96454708e', 'Encounter/d735c414-9dd3-c9b1-285c-8da79a7fbbdf', 'female', 'white', 'not hispanic or latino', '662') ('d73ed087-e0ae-78e0-7a05-1bac1060c476', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 45, datetime.date(2018, 7, 10), datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/51032f44-d514-26e9-3e85-e956561c076e', 'Encounter/d73ed087-e0ae-78e0-7a05-1bac1060c476', 'female', 'white', 'not hispanic or latino', '667') ('dc5ed645-3979-e765-3e03-6ba2173027c3', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 90, datetime.date(2018, 7, 7), datetime.date(2018, 7, 7), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/ac91b90d-97e4-4fc5-41cd-036bac49e6e8', 'Encounter/dc5ed645-3979-e765-3e03-6ba2173027c3', 'male', 'white', 'not hispanic or latino', '671') ('de9d67de-6ae3-32f7-20f2-e719ae23a9a3', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 3, datetime.date(2018, 7, 30), datetime.date(2018, 7, 30), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/2858705f-5af1-9869-4d94-894e09a9f99a', 'Encounter/de9d67de-6ae3-32f7-20f2-e719ae23a9a3', 'male', 'white', 'not hispanic or latino', '672') ('e5dabcb6-1d7a-7467-dbba-b864d0d5f5b0', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 49, datetime.date(2018, 7, 28), datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/0b052286-9534-99a8-8d5e-06c2c04a7df7', 'Encounter/e5dabcb6-1d7a-7467-dbba-b864d0d5f5b0', 'female', 'white', 'not hispanic or latino', '662') -('e613f29d-7505-6f2e-a1f5-bfbec300752d', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, '88805009', 'http://snomed.info/sct', None, None, 84, datetime.date(2018, 6, 29), datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/1c498b42-61fd-6341-69c3-053f6e4fe404', 'Encounter/e613f29d-7505-6f2e-a1f5-bfbec300752d', 'female', 'white', 'not hispanic or latino', '667') +('e613f29d-7505-6f2e-a1f5-bfbec300752d', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 84, datetime.date(2018, 6, 29), datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/1c498b42-61fd-6341-69c3-053f6e4fe404', 'Encounter/e613f29d-7505-6f2e-a1f5-bfbec300752d', 'female', 'white', 'not hispanic or latino', '667') ('e922a884-7039-a171-a65e-78051fe7afe6', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 1, datetime.date(2018, 6, 13), datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/8022fbbe-aaa4-056c-d0f5-ec074bf0656c', 'Encounter/e922a884-7039-a171-a65e-78051fe7afe6', 'male', 'white', 'not hispanic or latino', '665') -('ed151e04-3dd6-8cb7-a3e5-777c8a8667f1', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, '195662009', 'http://snomed.info/sct', None, None, 57, datetime.date(2018, 6, 6), datetime.date(2018, 6, 6), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/19158de4-66a2-f70f-e3bf-4396b312c8f1', 'Encounter/ed151e04-3dd6-8cb7-a3e5-777c8a8667f1', 'female', 'white', 'not hispanic or latino', '000') -('f2752dd7-1bf1-739d-dd8c-40122d0b63bc', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, '161665007', 'http://snomed.info/sct', None, None, 77, datetime.date(2018, 6, 1), datetime.date(2018, 6, 2), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/9c8d8539-0b1e-73e2-b64f-83f1ea601fa4', 'Encounter/f2752dd7-1bf1-739d-dd8c-40122d0b63bc', 'male', 'white', 'not hispanic or latino', '674') -('f964be66-3fcd-95c8-0021-71c7d24c91b7', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, '431857002', 'http://snomed.info/sct', None, None, 63, datetime.date(2018, 6, 5), datetime.date(2018, 6, 5), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/a5bc08ea-9462-c4f5-1bd2-ff342598ac99', 'Encounter/f964be66-3fcd-95c8-0021-71c7d24c91b7', 'female', 'white', 'not hispanic or latino', '661') +('ed151e04-3dd6-8cb7-a3e5-777c8a8667f1', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 57, datetime.date(2018, 6, 6), datetime.date(2018, 6, 6), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/19158de4-66a2-f70f-e3bf-4396b312c8f1', 'Encounter/ed151e04-3dd6-8cb7-a3e5-777c8a8667f1', 'female', 'white', 'not hispanic or latino', '000') +('f2752dd7-1bf1-739d-dd8c-40122d0b63bc', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 77, datetime.date(2018, 6, 1), datetime.date(2018, 6, 2), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/9c8d8539-0b1e-73e2-b64f-83f1ea601fa4', 'Encounter/f2752dd7-1bf1-739d-dd8c-40122d0b63bc', 'male', 'white', 'not hispanic or latino', '674') +('f964be66-3fcd-95c8-0021-71c7d24c91b7', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 63, datetime.date(2018, 6, 5), datetime.date(2018, 6, 5), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/a5bc08ea-9462-c4f5-1bd2-ff342598ac99', 'Encounter/f964be66-3fcd-95c8-0021-71c7d24c91b7', 'female', 'white', 'not hispanic or latino', '661') ('fd0754a4-e96d-cba7-b3c0-77697a09c86e', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 100, datetime.date(2018, 7, 10), datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/6385ddd7-2639-6505-3789-0521b8f66c8b', 'Encounter/fd0754a4-e96d-cba7-b3c0-77697a09c86e', 'female', 'white', 'not hispanic or latino', '672') diff --git a/tests/test_data/core/core__encounter_type.txt b/tests/test_data/core/core__encounter_type.txt index 732a4af7..5b5db79e 100644 --- a/tests/test_data/core/core__encounter_type.txt +++ b/tests/test_data/core/core__encounter_type.txt @@ -1,50 +1,50 @@ -('029d1814-d7bf-0624-524d-7ccda5f320f6', 'AMB', 'ambulatory', 'http://snomed.info/sct', '371883000', 'Outpatient procedure', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 15, datetime.date(2018, 6, 3), datetime.date(2018, 6, 3), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/e80dda2c-a260-dbf7-3167-bf0945f3a91d', 'Encounter/029d1814-d7bf-0624-524d-7ccda5f320f6', 'female', 'black or african american', 'not hispanic or latino', '672') -('02eb4e14-1a6f-d968-2c26-c0cf5023afe0', 'AMB', 'ambulatory', 'http://snomed.info/sct', '162673000', 'General examination of patient (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 57, datetime.date(2018, 6, 7), datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/c7ad408d-fcae-b54a-eb1d-26d48f7a5f84', 'Encounter/02eb4e14-1a6f-d968-2c26-c0cf5023afe0', 'female', 'white', 'not hispanic or latino', '660') -('03e34b19-2889-b828-792d-2a83400c55be', 'EMER', 'emergency', 'http://snomed.info/sct', '50849002', 'Emergency room admission (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 20, datetime.date(2018, 7, 19), datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/ad3ed58a-5645-af0a-eeca-ab543123a8aa', 'Encounter/03e34b19-2889-b828-792d-2a83400c55be', 'female', 'white', 'not hispanic or latino', '662') -('11381dc6-0e06-da55-0735-d1e7bbf8bb35', 'EMER', 'emergency', 'http://snomed.info/sct', '50849002', 'Emergency room admission (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 8, datetime.date(2018, 7, 15), datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/dffa62dc-8ec2-1cd6-ee75-f9156a5283fe', 'Encounter/11381dc6-0e06-da55-0735-d1e7bbf8bb35', 'male', 'white', 'hispanic or latino', '672') -('1154d05c-8727-9373-4224-25b9fdba9ab3', 'AMB', 'ambulatory', 'http://snomed.info/sct', '162673000', 'General examination of patient (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 25, datetime.date(2018, 6, 14), datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/24906e2c-e556-71dc-23d9-3e1d5fb08986', 'Encounter/1154d05c-8727-9373-4224-25b9fdba9ab3', 'female', 'white', 'hispanic or latino', '671') -('1d679c3a-2765-5e13-e2a3-4bd76a898fc6', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185349003', 'Encounter for check up', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 50, datetime.date(2018, 6, 15), datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/cb8c0665-30ee-479c-8994-d29f1a6848b0', 'Encounter/1d679c3a-2765-5e13-e2a3-4bd76a898fc6', 'male', 'white', 'not hispanic or latino', '662') -('299b6495-3fe7-8db3-c494-6e1ce8b7986d', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185349003', 'Encounter for check up (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 30, datetime.date(2018, 6, 2), datetime.date(2018, 6, 2), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/8877ef1f-7cd7-3242-d7f0-73cf3f7165f4', 'Encounter/299b6495-3fe7-8db3-c494-6e1ce8b7986d', 'male', 'black or african american', 'hispanic or latino', '660') -('2b1ee164-6c87-420d-a9e2-6c235ebeef71', 'AMB', 'ambulatory', 'http://snomed.info/sct', '702927004', 'Urgent care clinic (environment)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 15, datetime.date(2018, 6, 8), datetime.date(2018, 6, 8), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/6a883108-7b87-120b-d163-d369336e04e5', 'Encounter/2b1ee164-6c87-420d-a9e2-6c235ebeef71', 'male', 'white', 'not hispanic or latino', '672') -('2f55edb9-a906-0b40-e183-89b1d65d1aa1', 'AMB', 'ambulatory', 'http://snomed.info/sct', '371883000', 'Outpatient procedure', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 16, datetime.date(2018, 7, 21), datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/0734762a-9db6-22fc-b595-c3e472bb2a9a', 'Encounter/2f55edb9-a906-0b40-e183-89b1d65d1aa1', 'female', 'white', 'not hispanic or latino', '672') -('32d0ae2d-1be8-9e90-a4da-4c222abd88a9', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185349003', 'Encounter for check up (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 72, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/17fde357-dcc9-af8b-a8d3-4bd213afeb22', 'Encounter/32d0ae2d-1be8-9e90-a4da-4c222abd88a9', 'male', 'white', 'not hispanic or latino', '662') -('366df7d3-2ea9-db22-7cdd-60fa8a5c45ca', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185347001', 'Encounter for problem (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', '431857002', 'Chronic kidney disease stage 4 (disorder)', 'finished', 66, datetime.date(2018, 6, 15), datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/ad239efc-637c-e428-c829-b87e700d5446', 'Encounter/366df7d3-2ea9-db22-7cdd-60fa8a5c45ca', 'male', 'black or african american', 'not hispanic or latino', '678') -('37604257-be1a-120f-81ee-336f81603f92', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185347001', 'Encounter for problem (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', '431857002', 'Chronic kidney disease stage 4 (disorder)', 'finished', 48, datetime.date(2018, 7, 16), datetime.date(2018, 7, 16), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/50f8b42e-17a6-e932-8546-da94004c597c', 'Encounter/37604257-be1a-120f-81ee-336f81603f92', 'male', 'white', 'not hispanic or latino', '666') -('4b03a408-6694-88e3-0e63-3ee464ecd6cd', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185349003', 'Encounter for check up (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 73, datetime.date(2018, 7, 11), datetime.date(2018, 7, 11), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/5ce2e599-fb6e-9b4d-3c2e-87310619b957', 'Encounter/4b03a408-6694-88e3-0e63-3ee464ecd6cd', 'male', 'white', 'not hispanic or latino', '660') -('4c4d0730-201f-5b75-c657-8d0de09cc28f', 'AMB', 'ambulatory', 'http://snomed.info/sct', '702927004', 'Urgent care clinic (environment)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 60, datetime.date(2018, 6, 14), datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/267fc42d-cd9e-8527-1f9e-887fe7776147', 'Encounter/4c4d0730-201f-5b75-c657-8d0de09cc28f', 'female', 'white', 'not hispanic or latino', '676') -('5c3450fb-12f0-08f3-6e4d-8a5e433e19a4', 'AMB', 'ambulatory', 'http://snomed.info/sct', '308335008', 'Patient encounter procedure', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 46, datetime.date(2018, 6, 21), datetime.date(2018, 6, 21), datetime.date(2018, 6, 18), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/a46846ca-3f95-2cbb-3a9d-5eae150a0273', 'Encounter/5c3450fb-12f0-08f3-6e4d-8a5e433e19a4', 'female', 'white', 'not hispanic or latino', '660') -('5c994000-aa78-2be5-e6cf-99f230d50c2f', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185349003', 'Encounter for check up (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 81, datetime.date(2018, 7, 13), datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/9eaa056b-1efc-0cc8-70ff-62c8f704cc13', 'Encounter/5c994000-aa78-2be5-e6cf-99f230d50c2f', 'male', 'white', 'not hispanic or latino', '672') -('6565ef5c-30b9-8697-6ca6-2b77894d5437', 'AMB', 'ambulatory', 'http://snomed.info/sct', '308335008', 'Patient encounter procedure', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 19, datetime.date(2018, 7, 19), datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/d3c0274f-f42b-8d2b-15f2-82331e723383', 'Encounter/6565ef5c-30b9-8697-6ca6-2b77894d5437', 'female', 'white', 'not hispanic or latino', '668') -('65f8fdca-a949-80a0-8072-094e9aaee474', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185345009', 'Encounter for symptom', 'None', 'None', 'None', 'None', 'None', 'None', '10509002', 'Acute bronchitis (disorder)', 'finished', 9, datetime.date(2018, 6, 17), datetime.date(2018, 6, 17), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/7f941bcc-e7b2-99e1-585f-129d0ef1c13d', 'Encounter/65f8fdca-a949-80a0-8072-094e9aaee474', 'female', 'white', 'not hispanic or latino', '674') -('683b04eb-663a-849f-715f-4ccd70bf1524', 'AMB', 'ambulatory', 'http://snomed.info/sct', '410620009', 'Well child visit (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 12, datetime.date(2018, 7, 26), datetime.date(2018, 7, 26), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/cc9fb8e2-fe52-b72a-aebb-9d10260f121b', 'Encounter/683b04eb-663a-849f-715f-4ccd70bf1524', 'female', 'white', 'not hispanic or latino', '660') -('6a952afd-3be5-e27e-9e05-5a1e085e34d0', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185345009', 'Encounter for symptom', 'None', 'None', 'None', 'None', 'None', 'None', '444814009', 'Viral sinusitis (disorder)', 'finished', 16, datetime.date(2018, 7, 21), datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/f9399f0d-5401-09f3-d4ff-89b1aa51b9c8', 'Encounter/6a952afd-3be5-e27e-9e05-5a1e085e34d0', 'male', 'white', 'not hispanic or latino', '674') -('75312bd2-d5ac-c62e-c9df-0004783725c7', 'AMB', 'ambulatory', 'http://snomed.info/sct', '410620009', 'Well child visit (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 11, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/3ae095ec-8fe0-133b-36d4-8785a6ad8df3', 'Encounter/75312bd2-d5ac-c62e-c9df-0004783725c7', 'female', 'white', 'not hispanic or latino', '662') -('75b68644-535d-bdc1-4c31-aa9fe7e1822f', 'EMER', 'emergency', 'http://snomed.info/sct', '50849002', 'Emergency room admission (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', '55680006', 'Drug overdose', 'finished', 25, datetime.date(2018, 6, 30), datetime.date(2018, 6, 30), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/82b8a670-4700-30e8-24a0-b83efa3c5e0a', 'Encounter/75b68644-535d-bdc1-4c31-aa9fe7e1822f', 'female', 'white', 'not hispanic or latino', '672') -('79d8f213-7847-646b-8a66-5da208cc1c27', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185347001', 'Encounter for problem (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', '431857002', 'Chronic kidney disease stage 4 (disorder)', 'finished', 77, datetime.date(2018, 7, 14), datetime.date(2018, 7, 14), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/26a3984f-b2a8-e67f-7abc-ff147a0e6e35', 'Encounter/79d8f213-7847-646b-8a66-5da208cc1c27', 'male', 'white', 'not hispanic or latino', '674') -('83d0d564-3bbf-48eb-7445-bd2b81130671', 'EMER', 'emergency', 'http://snomed.info/sct', '50849002', 'Emergency room admission (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', '55680006', 'Drug overdose', 'finished', 69, datetime.date(2018, 6, 16), datetime.date(2018, 6, 17), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/16be855b-ece2-8b96-1ef9-a4d93adf3289', 'Encounter/83d0d564-3bbf-48eb-7445-bd2b81130671', 'male', 'white', 'not hispanic or latino', '660') -('8ff1dc01-5a28-b2d8-3b42-4b7a7d539970', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185349003', 'Encounter for check up (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 55, datetime.date(2018, 7, 15), datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/c1bfec36-dc2c-afc8-c767-3d35ed2bf6f0', 'Encounter/8ff1dc01-5a28-b2d8-3b42-4b7a7d539970', 'female', 'white', 'not hispanic or latino', '662') -('91f94a9d-69a7-e30a-cd1a-68c52dc01e70', 'AMB', 'ambulatory', 'http://snomed.info/sct', '308335008', 'Patient encounter procedure', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 22, datetime.date(2018, 6, 29), datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/a28be3e1-a6bd-7df4-fc81-1140848f8453', 'Encounter/91f94a9d-69a7-e30a-cd1a-68c52dc01e70', 'female', 'white', 'not hispanic or latino', '662') -('98d4bd14-d78e-debb-e7dc-2df7786aedf3', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185349003', 'Encounter for check up (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 89, datetime.date(2018, 7, 9), datetime.date(2018, 7, 9), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/e455ca3f-fc16-6ffc-297a-adc27e2db183', 'Encounter/98d4bd14-d78e-debb-e7dc-2df7786aedf3', 'male', 'white', 'hispanic or latino', '667') -('aa890974-162f-5906-dc71-2bb6d2185314', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185347001', 'Encounter for problem (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', '431857002', 'Chronic kidney disease stage 4 (disorder)', 'finished', 50, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/c7c5c028-f1fb-962b-8db2-dfd4c6d6b02a', 'Encounter/aa890974-162f-5906-dc71-2bb6d2185314', 'male', 'white', 'not hispanic or latino', '672') -('aabb3ac3-c4a3-f613-9507-63280adb9209', 'AMB', 'ambulatory', 'http://snomed.info/sct', '410620009', 'Well child visit (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 0, datetime.date(2018, 7, 31), datetime.date(2018, 7, 31), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/2a0e1946-acf6-5a7e-9399-a9cbc4730199', 'Encounter/aabb3ac3-c4a3-f613-9507-63280adb9209', 'female', 'white', 'not hispanic or latino', '675') -('b5974881-ae62-ddd6-b905-8c86c1ca9e33', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185347001', 'Encounter for problem', 'None', 'None', 'None', 'None', 'None', 'None', '271737000', 'Anemia (disorder)', 'finished', 41, datetime.date(2018, 6, 25), datetime.date(2018, 6, 25), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/47c37c92-5932-9cfe-66be-208556780fe0', 'Encounter/b5974881-ae62-ddd6-b905-8c86c1ca9e33', 'male', 'white', 'not hispanic or latino', '675') -('b864bcd8-14e0-8bec-b7cc-f8629d91470e', 'AMB', 'ambulatory', 'http://snomed.info/sct', '698314001', 'Consultation for treatment', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 15, datetime.date(2018, 6, 28), datetime.date(2018, 6, 28), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/c20e5afd-30df-ac3d-6684-cc29438a9bc4', 'Encounter/b864bcd8-14e0-8bec-b7cc-f8629d91470e', 'female', 'white', 'not hispanic or latino', '662') -('ba84689e-2f9f-7cea-af1f-d69ffdd3a3eb', 'AMB', 'ambulatory', 'http://snomed.info/sct', '698314001', 'Consultation for treatment', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 39, datetime.date(2018, 6, 15), datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/7bf52d54-0d2a-265a-15aa-eeed7aaf4af6', 'Encounter/ba84689e-2f9f-7cea-af1f-d69ffdd3a3eb', 'female', 'white', 'not hispanic or latino', '670') -('bca7cabc-b2fc-8a08-c69b-5bc0afa20d80', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185347001', 'Encounter for problem', 'None', 'None', 'None', 'None', 'None', 'None', '271737000', 'Anemia (disorder)', 'finished', 28, datetime.date(2018, 7, 13), datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/3627adb8-f741-acf3-2dd6-10f3bcbe1077', 'Encounter/bca7cabc-b2fc-8a08-c69b-5bc0afa20d80', 'female', 'white', 'not hispanic or latino', '674') -('beb26500-4ccd-ce0a-44f6-74f44be5fafe', 'AMB', 'ambulatory', 'http://snomed.info/sct', '698314001', 'Consultation for treatment', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 14, datetime.date(2018, 6, 7), datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/149de67a-2809-59a8-bfa2-36df509021dc', 'Encounter/beb26500-4ccd-ce0a-44f6-74f44be5fafe', 'female', 'white', 'not hispanic or latino', '667') -('c4605953-3103-ede6-e0c0-e0588e6f019e', 'AMB', 'ambulatory', 'http://snomed.info/sct', '162673000', 'General examination of patient (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 61, datetime.date(2018, 7, 27), datetime.date(2018, 7, 27), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/a5b171a7-9b28-20e7-86a7-936ecbf55f36', 'Encounter/c4605953-3103-ede6-e0c0-e0588e6f019e', 'female', 'white', 'not hispanic or latino', '675') -('c6ec2350-43d4-abab-2e84-4d2aadb337a7', 'AMB', 'ambulatory', 'http://snomed.info/sct', '162673000', 'General examination of patient (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 53, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/26baae20-c8c5-003a-ab6b-ebcc49be20db', 'Encounter/c6ec2350-43d4-abab-2e84-4d2aadb337a7', 'male', 'white', 'not hispanic or latino', '678') -('ca45bbef-ef2a-3b3c-ea5e-76bcd5865780', 'AMB', 'ambulatory', 'http://snomed.info/sct', '424619006', 'Prenatal visit', 'None', 'None', 'None', 'None', 'None', 'None', '72892002', 'Normal pregnancy', 'finished', 48, datetime.date(2018, 6, 12), datetime.date(2018, 6, 12), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/9b17654f-a902-3d56-9000-4ade3dd3059f', 'Encounter/ca45bbef-ef2a-3b3c-ea5e-76bcd5865780', 'female', 'white', 'hispanic or latino', '672') -('d2782687-6885-037c-957d-579fbd681d2a', 'AMB', 'ambulatory', 'http://snomed.info/sct', '162673000', 'General examination of patient (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 54, datetime.date(2018, 6, 13), datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/3cf7af45-2bee-aa9c-d524-40b487149d60', 'Encounter/d2782687-6885-037c-957d-579fbd681d2a', 'male', 'white', 'not hispanic or latino', '000') -('d5f342b7-017c-f2e7-8697-5a038c91518e', 'AMB', 'ambulatory', 'http://snomed.info/sct', '424619006', 'Prenatal visit', 'None', 'None', 'None', 'None', 'None', 'None', '72892002', 'Normal pregnancy', 'finished', 20, datetime.date(2018, 7, 28), datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/2da1bee2-2bc2-4511-84e1-42860310e2fb', 'Encounter/d5f342b7-017c-f2e7-8697-5a038c91518e', 'female', 'white', 'not hispanic or latino', '660') -('d735c414-9dd3-c9b1-285c-8da79a7fbbdf', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185347001', 'Encounter for problem (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', '431857002', 'Chronic kidney disease stage 4 (disorder)', 'finished', 61, datetime.date(2018, 7, 29), datetime.date(2018, 7, 29), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/7cef0e6f-9aea-4079-dfc6-18a96454708e', 'Encounter/d735c414-9dd3-c9b1-285c-8da79a7fbbdf', 'female', 'white', 'not hispanic or latino', '662') -('d73ed087-e0ae-78e0-7a05-1bac1060c476', 'AMB', 'ambulatory', 'http://snomed.info/sct', '698314001', 'Consultation for treatment', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 45, datetime.date(2018, 7, 10), datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/51032f44-d514-26e9-3e85-e956561c076e', 'Encounter/d73ed087-e0ae-78e0-7a05-1bac1060c476', 'female', 'white', 'not hispanic or latino', '667') -('dc5ed645-3979-e765-3e03-6ba2173027c3', 'AMB', 'ambulatory', 'http://snomed.info/sct', '702927004', 'Urgent care clinic (environment)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 90, datetime.date(2018, 7, 7), datetime.date(2018, 7, 7), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/ac91b90d-97e4-4fc5-41cd-036bac49e6e8', 'Encounter/dc5ed645-3979-e765-3e03-6ba2173027c3', 'male', 'white', 'not hispanic or latino', '671') -('de9d67de-6ae3-32f7-20f2-e719ae23a9a3', 'AMB', 'ambulatory', 'http://snomed.info/sct', '410620009', 'Well child visit (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 3, datetime.date(2018, 7, 30), datetime.date(2018, 7, 30), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/2858705f-5af1-9869-4d94-894e09a9f99a', 'Encounter/de9d67de-6ae3-32f7-20f2-e719ae23a9a3', 'male', 'white', 'not hispanic or latino', '672') -('e5dabcb6-1d7a-7467-dbba-b864d0d5f5b0', 'AMB', 'ambulatory', 'http://snomed.info/sct', '162673000', 'General examination of patient (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 49, datetime.date(2018, 7, 28), datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/0b052286-9534-99a8-8d5e-06c2c04a7df7', 'Encounter/e5dabcb6-1d7a-7467-dbba-b864d0d5f5b0', 'female', 'white', 'not hispanic or latino', '662') -('e613f29d-7505-6f2e-a1f5-bfbec300752d', 'AMB', 'ambulatory', 'http://snomed.info/sct', '448337001', 'Telemedicine consultation with patient', 'None', 'None', 'None', 'None', 'None', 'None', '88805009', 'Chronic congestive heart failure (disorder)', 'finished', 84, datetime.date(2018, 6, 29), datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/1c498b42-61fd-6341-69c3-053f6e4fe404', 'Encounter/e613f29d-7505-6f2e-a1f5-bfbec300752d', 'female', 'white', 'not hispanic or latino', '667') -('e922a884-7039-a171-a65e-78051fe7afe6', 'AMB', 'ambulatory', 'http://snomed.info/sct', '410620009', 'Well child visit (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 1, datetime.date(2018, 6, 13), datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/8022fbbe-aaa4-056c-d0f5-ec074bf0656c', 'Encounter/e922a884-7039-a171-a65e-78051fe7afe6', 'male', 'white', 'not hispanic or latino', '665') -('ed151e04-3dd6-8cb7-a3e5-777c8a8667f1', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185345009', 'Encounter for symptom', 'None', 'None', 'None', 'None', 'None', 'None', '195662009', 'Acute viral pharyngitis (disorder)', 'finished', 57, datetime.date(2018, 6, 6), datetime.date(2018, 6, 6), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/19158de4-66a2-f70f-e3bf-4396b312c8f1', 'Encounter/ed151e04-3dd6-8cb7-a3e5-777c8a8667f1', 'female', 'white', 'not hispanic or latino', '000') -('f2752dd7-1bf1-739d-dd8c-40122d0b63bc', 'AMB', 'ambulatory', 'http://snomed.info/sct', '439740005', 'Postoperative follow-up visit (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', '161665007', 'History of renal transplant (situation)', 'finished', 77, datetime.date(2018, 6, 1), datetime.date(2018, 6, 2), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/9c8d8539-0b1e-73e2-b64f-83f1ea601fa4', 'Encounter/f2752dd7-1bf1-739d-dd8c-40122d0b63bc', 'male', 'white', 'not hispanic or latino', '674') -('f964be66-3fcd-95c8-0021-71c7d24c91b7', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185347001', 'Encounter for problem (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', '431857002', 'Chronic kidney disease stage 4 (disorder)', 'finished', 63, datetime.date(2018, 6, 5), datetime.date(2018, 6, 5), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/a5bc08ea-9462-c4f5-1bd2-ff342598ac99', 'Encounter/f964be66-3fcd-95c8-0021-71c7d24c91b7', 'female', 'white', 'not hispanic or latino', '661') -('fd0754a4-e96d-cba7-b3c0-77697a09c86e', 'AMB', 'ambulatory', 'http://snomed.info/sct', '702927004', 'Urgent care clinic (environment)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 100, datetime.date(2018, 7, 10), datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/6385ddd7-2639-6505-3789-0521b8f66c8b', 'Encounter/fd0754a4-e96d-cba7-b3c0-77697a09c86e', 'female', 'white', 'not hispanic or latino', '672') +('029d1814-d7bf-0624-524d-7ccda5f320f6', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 15, datetime.date(2018, 6, 3), datetime.date(2018, 6, 3), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/e80dda2c-a260-dbf7-3167-bf0945f3a91d', 'Encounter/029d1814-d7bf-0624-524d-7ccda5f320f6', 'female', 'black or african american', 'not hispanic or latino', '672') +('02eb4e14-1a6f-d968-2c26-c0cf5023afe0', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 57, datetime.date(2018, 6, 7), datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/c7ad408d-fcae-b54a-eb1d-26d48f7a5f84', 'Encounter/02eb4e14-1a6f-d968-2c26-c0cf5023afe0', 'female', 'white', 'not hispanic or latino', '660') +('03e34b19-2889-b828-792d-2a83400c55be', 'EMER', 'emergency', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 20, datetime.date(2018, 7, 19), datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/ad3ed58a-5645-af0a-eeca-ab543123a8aa', 'Encounter/03e34b19-2889-b828-792d-2a83400c55be', 'female', 'white', 'not hispanic or latino', '662') +('11381dc6-0e06-da55-0735-d1e7bbf8bb35', 'EMER', 'emergency', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 8, datetime.date(2018, 7, 15), datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/dffa62dc-8ec2-1cd6-ee75-f9156a5283fe', 'Encounter/11381dc6-0e06-da55-0735-d1e7bbf8bb35', 'male', 'white', 'hispanic or latino', '672') +('1154d05c-8727-9373-4224-25b9fdba9ab3', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 25, datetime.date(2018, 6, 14), datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/24906e2c-e556-71dc-23d9-3e1d5fb08986', 'Encounter/1154d05c-8727-9373-4224-25b9fdba9ab3', 'female', 'white', 'hispanic or latino', '671') +('1d679c3a-2765-5e13-e2a3-4bd76a898fc6', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 50, datetime.date(2018, 6, 15), datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/cb8c0665-30ee-479c-8994-d29f1a6848b0', 'Encounter/1d679c3a-2765-5e13-e2a3-4bd76a898fc6', 'male', 'white', 'not hispanic or latino', '662') +('299b6495-3fe7-8db3-c494-6e1ce8b7986d', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 30, datetime.date(2018, 6, 2), datetime.date(2018, 6, 2), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/8877ef1f-7cd7-3242-d7f0-73cf3f7165f4', 'Encounter/299b6495-3fe7-8db3-c494-6e1ce8b7986d', 'male', 'black or african american', 'hispanic or latino', '660') +('2b1ee164-6c87-420d-a9e2-6c235ebeef71', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 15, datetime.date(2018, 6, 8), datetime.date(2018, 6, 8), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/6a883108-7b87-120b-d163-d369336e04e5', 'Encounter/2b1ee164-6c87-420d-a9e2-6c235ebeef71', 'male', 'white', 'not hispanic or latino', '672') +('2f55edb9-a906-0b40-e183-89b1d65d1aa1', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 16, datetime.date(2018, 7, 21), datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/0734762a-9db6-22fc-b595-c3e472bb2a9a', 'Encounter/2f55edb9-a906-0b40-e183-89b1d65d1aa1', 'female', 'white', 'not hispanic or latino', '672') +('32d0ae2d-1be8-9e90-a4da-4c222abd88a9', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 72, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/17fde357-dcc9-af8b-a8d3-4bd213afeb22', 'Encounter/32d0ae2d-1be8-9e90-a4da-4c222abd88a9', 'male', 'white', 'not hispanic or latino', '662') +('366df7d3-2ea9-db22-7cdd-60fa8a5c45ca', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 66, datetime.date(2018, 6, 15), datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/ad239efc-637c-e428-c829-b87e700d5446', 'Encounter/366df7d3-2ea9-db22-7cdd-60fa8a5c45ca', 'male', 'black or african american', 'not hispanic or latino', '678') +('37604257-be1a-120f-81ee-336f81603f92', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 48, datetime.date(2018, 7, 16), datetime.date(2018, 7, 16), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/50f8b42e-17a6-e932-8546-da94004c597c', 'Encounter/37604257-be1a-120f-81ee-336f81603f92', 'male', 'white', 'not hispanic or latino', '666') +('4b03a408-6694-88e3-0e63-3ee464ecd6cd', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 73, datetime.date(2018, 7, 11), datetime.date(2018, 7, 11), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/5ce2e599-fb6e-9b4d-3c2e-87310619b957', 'Encounter/4b03a408-6694-88e3-0e63-3ee464ecd6cd', 'male', 'white', 'not hispanic or latino', '660') +('4c4d0730-201f-5b75-c657-8d0de09cc28f', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 60, datetime.date(2018, 6, 14), datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/267fc42d-cd9e-8527-1f9e-887fe7776147', 'Encounter/4c4d0730-201f-5b75-c657-8d0de09cc28f', 'female', 'white', 'not hispanic or latino', '676') +('5c3450fb-12f0-08f3-6e4d-8a5e433e19a4', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 46, datetime.date(2018, 6, 21), datetime.date(2018, 6, 21), datetime.date(2018, 6, 18), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/a46846ca-3f95-2cbb-3a9d-5eae150a0273', 'Encounter/5c3450fb-12f0-08f3-6e4d-8a5e433e19a4', 'female', 'white', 'not hispanic or latino', '660') +('5c994000-aa78-2be5-e6cf-99f230d50c2f', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 81, datetime.date(2018, 7, 13), datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/9eaa056b-1efc-0cc8-70ff-62c8f704cc13', 'Encounter/5c994000-aa78-2be5-e6cf-99f230d50c2f', 'male', 'white', 'not hispanic or latino', '672') +('6565ef5c-30b9-8697-6ca6-2b77894d5437', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 19, datetime.date(2018, 7, 19), datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/d3c0274f-f42b-8d2b-15f2-82331e723383', 'Encounter/6565ef5c-30b9-8697-6ca6-2b77894d5437', 'female', 'white', 'not hispanic or latino', '668') +('65f8fdca-a949-80a0-8072-094e9aaee474', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 9, datetime.date(2018, 6, 17), datetime.date(2018, 6, 17), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/7f941bcc-e7b2-99e1-585f-129d0ef1c13d', 'Encounter/65f8fdca-a949-80a0-8072-094e9aaee474', 'female', 'white', 'not hispanic or latino', '674') +('683b04eb-663a-849f-715f-4ccd70bf1524', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 12, datetime.date(2018, 7, 26), datetime.date(2018, 7, 26), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/cc9fb8e2-fe52-b72a-aebb-9d10260f121b', 'Encounter/683b04eb-663a-849f-715f-4ccd70bf1524', 'female', 'white', 'not hispanic or latino', '660') +('6a952afd-3be5-e27e-9e05-5a1e085e34d0', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 16, datetime.date(2018, 7, 21), datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/f9399f0d-5401-09f3-d4ff-89b1aa51b9c8', 'Encounter/6a952afd-3be5-e27e-9e05-5a1e085e34d0', 'male', 'white', 'not hispanic or latino', '674') +('75312bd2-d5ac-c62e-c9df-0004783725c7', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 11, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/3ae095ec-8fe0-133b-36d4-8785a6ad8df3', 'Encounter/75312bd2-d5ac-c62e-c9df-0004783725c7', 'female', 'white', 'not hispanic or latino', '662') +('75b68644-535d-bdc1-4c31-aa9fe7e1822f', 'EMER', 'emergency', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 25, datetime.date(2018, 6, 30), datetime.date(2018, 6, 30), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/82b8a670-4700-30e8-24a0-b83efa3c5e0a', 'Encounter/75b68644-535d-bdc1-4c31-aa9fe7e1822f', 'female', 'white', 'not hispanic or latino', '672') +('79d8f213-7847-646b-8a66-5da208cc1c27', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 77, datetime.date(2018, 7, 14), datetime.date(2018, 7, 14), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/26a3984f-b2a8-e67f-7abc-ff147a0e6e35', 'Encounter/79d8f213-7847-646b-8a66-5da208cc1c27', 'male', 'white', 'not hispanic or latino', '674') +('83d0d564-3bbf-48eb-7445-bd2b81130671', 'EMER', 'emergency', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 69, datetime.date(2018, 6, 16), datetime.date(2018, 6, 17), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/16be855b-ece2-8b96-1ef9-a4d93adf3289', 'Encounter/83d0d564-3bbf-48eb-7445-bd2b81130671', 'male', 'white', 'not hispanic or latino', '660') +('8ff1dc01-5a28-b2d8-3b42-4b7a7d539970', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 55, datetime.date(2018, 7, 15), datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/c1bfec36-dc2c-afc8-c767-3d35ed2bf6f0', 'Encounter/8ff1dc01-5a28-b2d8-3b42-4b7a7d539970', 'female', 'white', 'not hispanic or latino', '662') +('91f94a9d-69a7-e30a-cd1a-68c52dc01e70', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 22, datetime.date(2018, 6, 29), datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/a28be3e1-a6bd-7df4-fc81-1140848f8453', 'Encounter/91f94a9d-69a7-e30a-cd1a-68c52dc01e70', 'female', 'white', 'not hispanic or latino', '662') +('98d4bd14-d78e-debb-e7dc-2df7786aedf3', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 89, datetime.date(2018, 7, 9), datetime.date(2018, 7, 9), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/e455ca3f-fc16-6ffc-297a-adc27e2db183', 'Encounter/98d4bd14-d78e-debb-e7dc-2df7786aedf3', 'male', 'white', 'hispanic or latino', '667') +('aa890974-162f-5906-dc71-2bb6d2185314', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 50, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/c7c5c028-f1fb-962b-8db2-dfd4c6d6b02a', 'Encounter/aa890974-162f-5906-dc71-2bb6d2185314', 'male', 'white', 'not hispanic or latino', '672') +('aabb3ac3-c4a3-f613-9507-63280adb9209', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 0, datetime.date(2018, 7, 31), datetime.date(2018, 7, 31), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/2a0e1946-acf6-5a7e-9399-a9cbc4730199', 'Encounter/aabb3ac3-c4a3-f613-9507-63280adb9209', 'female', 'white', 'not hispanic or latino', '675') +('b5974881-ae62-ddd6-b905-8c86c1ca9e33', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 41, datetime.date(2018, 6, 25), datetime.date(2018, 6, 25), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/47c37c92-5932-9cfe-66be-208556780fe0', 'Encounter/b5974881-ae62-ddd6-b905-8c86c1ca9e33', 'male', 'white', 'not hispanic or latino', '675') +('b864bcd8-14e0-8bec-b7cc-f8629d91470e', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 15, datetime.date(2018, 6, 28), datetime.date(2018, 6, 28), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/c20e5afd-30df-ac3d-6684-cc29438a9bc4', 'Encounter/b864bcd8-14e0-8bec-b7cc-f8629d91470e', 'female', 'white', 'not hispanic or latino', '662') +('ba84689e-2f9f-7cea-af1f-d69ffdd3a3eb', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 39, datetime.date(2018, 6, 15), datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/7bf52d54-0d2a-265a-15aa-eeed7aaf4af6', 'Encounter/ba84689e-2f9f-7cea-af1f-d69ffdd3a3eb', 'female', 'white', 'not hispanic or latino', '670') +('bca7cabc-b2fc-8a08-c69b-5bc0afa20d80', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 28, datetime.date(2018, 7, 13), datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/3627adb8-f741-acf3-2dd6-10f3bcbe1077', 'Encounter/bca7cabc-b2fc-8a08-c69b-5bc0afa20d80', 'female', 'white', 'not hispanic or latino', '674') +('beb26500-4ccd-ce0a-44f6-74f44be5fafe', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 14, datetime.date(2018, 6, 7), datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/149de67a-2809-59a8-bfa2-36df509021dc', 'Encounter/beb26500-4ccd-ce0a-44f6-74f44be5fafe', 'female', 'white', 'not hispanic or latino', '667') +('c4605953-3103-ede6-e0c0-e0588e6f019e', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 61, datetime.date(2018, 7, 27), datetime.date(2018, 7, 27), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/a5b171a7-9b28-20e7-86a7-936ecbf55f36', 'Encounter/c4605953-3103-ede6-e0c0-e0588e6f019e', 'female', 'white', 'not hispanic or latino', '675') +('c6ec2350-43d4-abab-2e84-4d2aadb337a7', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 53, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/26baae20-c8c5-003a-ab6b-ebcc49be20db', 'Encounter/c6ec2350-43d4-abab-2e84-4d2aadb337a7', 'male', 'white', 'not hispanic or latino', '678') +('ca45bbef-ef2a-3b3c-ea5e-76bcd5865780', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 48, datetime.date(2018, 6, 12), datetime.date(2018, 6, 12), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/9b17654f-a902-3d56-9000-4ade3dd3059f', 'Encounter/ca45bbef-ef2a-3b3c-ea5e-76bcd5865780', 'female', 'white', 'hispanic or latino', '672') +('d2782687-6885-037c-957d-579fbd681d2a', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 54, datetime.date(2018, 6, 13), datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/3cf7af45-2bee-aa9c-d524-40b487149d60', 'Encounter/d2782687-6885-037c-957d-579fbd681d2a', 'male', 'white', 'not hispanic or latino', '000') +('d5f342b7-017c-f2e7-8697-5a038c91518e', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 20, datetime.date(2018, 7, 28), datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/2da1bee2-2bc2-4511-84e1-42860310e2fb', 'Encounter/d5f342b7-017c-f2e7-8697-5a038c91518e', 'female', 'white', 'not hispanic or latino', '660') +('d735c414-9dd3-c9b1-285c-8da79a7fbbdf', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 61, datetime.date(2018, 7, 29), datetime.date(2018, 7, 29), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/7cef0e6f-9aea-4079-dfc6-18a96454708e', 'Encounter/d735c414-9dd3-c9b1-285c-8da79a7fbbdf', 'female', 'white', 'not hispanic or latino', '662') +('d73ed087-e0ae-78e0-7a05-1bac1060c476', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 45, datetime.date(2018, 7, 10), datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/51032f44-d514-26e9-3e85-e956561c076e', 'Encounter/d73ed087-e0ae-78e0-7a05-1bac1060c476', 'female', 'white', 'not hispanic or latino', '667') +('dc5ed645-3979-e765-3e03-6ba2173027c3', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 90, datetime.date(2018, 7, 7), datetime.date(2018, 7, 7), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/ac91b90d-97e4-4fc5-41cd-036bac49e6e8', 'Encounter/dc5ed645-3979-e765-3e03-6ba2173027c3', 'male', 'white', 'not hispanic or latino', '671') +('de9d67de-6ae3-32f7-20f2-e719ae23a9a3', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 3, datetime.date(2018, 7, 30), datetime.date(2018, 7, 30), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/2858705f-5af1-9869-4d94-894e09a9f99a', 'Encounter/de9d67de-6ae3-32f7-20f2-e719ae23a9a3', 'male', 'white', 'not hispanic or latino', '672') +('e5dabcb6-1d7a-7467-dbba-b864d0d5f5b0', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 49, datetime.date(2018, 7, 28), datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/0b052286-9534-99a8-8d5e-06c2c04a7df7', 'Encounter/e5dabcb6-1d7a-7467-dbba-b864d0d5f5b0', 'female', 'white', 'not hispanic or latino', '662') +('e613f29d-7505-6f2e-a1f5-bfbec300752d', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 84, datetime.date(2018, 6, 29), datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/1c498b42-61fd-6341-69c3-053f6e4fe404', 'Encounter/e613f29d-7505-6f2e-a1f5-bfbec300752d', 'female', 'white', 'not hispanic or latino', '667') +('e922a884-7039-a171-a65e-78051fe7afe6', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 1, datetime.date(2018, 6, 13), datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/8022fbbe-aaa4-056c-d0f5-ec074bf0656c', 'Encounter/e922a884-7039-a171-a65e-78051fe7afe6', 'male', 'white', 'not hispanic or latino', '665') +('ed151e04-3dd6-8cb7-a3e5-777c8a8667f1', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 57, datetime.date(2018, 6, 6), datetime.date(2018, 6, 6), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/19158de4-66a2-f70f-e3bf-4396b312c8f1', 'Encounter/ed151e04-3dd6-8cb7-a3e5-777c8a8667f1', 'female', 'white', 'not hispanic or latino', '000') +('f2752dd7-1bf1-739d-dd8c-40122d0b63bc', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 77, datetime.date(2018, 6, 1), datetime.date(2018, 6, 2), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/9c8d8539-0b1e-73e2-b64f-83f1ea601fa4', 'Encounter/f2752dd7-1bf1-739d-dd8c-40122d0b63bc', 'male', 'white', 'not hispanic or latino', '674') +('f964be66-3fcd-95c8-0021-71c7d24c91b7', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 63, datetime.date(2018, 6, 5), datetime.date(2018, 6, 5), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/a5bc08ea-9462-c4f5-1bd2-ff342598ac99', 'Encounter/f964be66-3fcd-95c8-0021-71c7d24c91b7', 'female', 'white', 'not hispanic or latino', '661') +('fd0754a4-e96d-cba7-b3c0-77697a09c86e', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 100, datetime.date(2018, 7, 10), datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/6385ddd7-2639-6505-3789-0521b8f66c8b', 'Encounter/fd0754a4-e96d-cba7-b3c0-77697a09c86e', 'female', 'white', 'not hispanic or latino', '672') diff --git a/tests/test_data/discovery/discovery__code_sources.txt b/tests/test_data/discovery/discovery__code_sources.txt new file mode 100644 index 00000000..36f27efd --- /dev/null +++ b/tests/test_data/discovery/discovery__code_sources.txt @@ -0,0 +1,30 @@ +condition,category,,, +condition,code,10509002,Acute bronchitis (disorder),http://snomed.info/sct +condition,code,160903007,Full-time employment (finding),http://snomed.info/sct +condition,code,195662009,Acute viral pharyngitis (disorder),http://snomed.info/sct +condition,code,33737001,Fracture of rib,http://snomed.info/sct +condition,code,368581000119106,Neuropathy due to type 2 diabetes mellitus (disorder),http://snomed.info/sct +condition,code,422650009,Social isolation (finding),http://snomed.info/sct +condition,code,424393004,Reports of violence in the environment (finding),http://snomed.info/sct +condition,code,44465007,Sprain of ankle,http://snomed.info/sct +condition,code,444814009,Viral sinusitis (disorder),http://snomed.info/sct +condition,code,73595000,Stress (finding),http://snomed.info/sct +condition,code,741062008,Not in labor force (finding),http://snomed.info/sct +documentreference,category,,, +documentreference,type,,, +encounter,class,AMB,None,http://terminology.hl7.org/CodeSystem/v3-ActCode +encounter,class,EMER,None,http://terminology.hl7.org/CodeSystem/v3-ActCode +encounter,hospitalization.dischargedisposition,,, +encounter,priority,,, +encounter,reasoncode,,, +encounter,servicetype,,, +encounter,type,,, +medication,codecodeableconcept ,,, +medication,medicationcode,,, +observation,category,,, +observation,code,34533-0,Odor of Urine,http://loinc.org +observation,code,5778-6,Color of Urine,http://loinc.org +observation,dataabsentreason,,, +observation,interpretation,,, +observation,valuecodeableconcept,,, +patient,maritalstatus,,, diff --git a/tests/test_data/duckdb_data/expected_export/core/core__count_encounter_enc_type_month.csv b/tests/test_data/duckdb_data/expected_export/core/core__count_encounter_enc_type_month.csv index 2f66e7fd..6f79e0cd 100644 --- a/tests/test_data/duckdb_data/expected_export/core/core__count_encounter_enc_type_month.csv +++ b/tests/test_data/duckdb_data/expected_export/core/core__count_encounter_enc_type_month.csv @@ -1,7 +1,13 @@ cnt,enc_class_display,enc_type_display,start_month 50,,, +50,,None, 46,ambulatory,, +46,ambulatory,None, 26,,,2018-07-01 +26,,None,2018-07-01 24,,,2018-06-01 +24,,None,2018-06-01 24,ambulatory,,2018-07-01 +24,ambulatory,None,2018-07-01 22,ambulatory,,2018-06-01 +22,ambulatory,None,2018-06-01 diff --git a/tests/test_data/duckdb_data/expected_export/core/core__count_encounter_type.csv b/tests/test_data/duckdb_data/expected_export/core/core__count_encounter_type.csv index 61e6f092..4207fcc7 100644 --- a/tests/test_data/duckdb_data/expected_export/core/core__count_encounter_type.csv +++ b/tests/test_data/duckdb_data/expected_export/core/core__count_encounter_type.csv @@ -3,7 +3,15 @@ cnt,enc_class_display,enc_type_display,enc_service_display,enc_priority_display 50,,,,None 50,,,None, 50,,,None,None +50,,None,, +50,,None,,None +50,,None,None, +50,,None,None,None 46,ambulatory,,, 46,ambulatory,,,None 46,ambulatory,,None, 46,ambulatory,,None,None +46,ambulatory,None,, +46,ambulatory,None,,None +46,ambulatory,None,None, +46,ambulatory,None,None,None diff --git a/tests/test_data/duckdb_data/expected_export/core/core__count_encounter_type_month.csv b/tests/test_data/duckdb_data/expected_export/core/core__count_encounter_type_month.csv index 610aa74b..99f73572 100644 --- a/tests/test_data/duckdb_data/expected_export/core/core__count_encounter_type_month.csv +++ b/tests/test_data/duckdb_data/expected_export/core/core__count_encounter_type_month.csv @@ -3,23 +3,47 @@ cnt,enc_class_display,enc_type_display,enc_service_display,enc_priority_display, 50,,,,None, 50,,,None,, 50,,,None,None, +50,,None,,, +50,,None,,None, +50,,None,None,, +50,,None,None,None, 46,ambulatory,,,, 46,ambulatory,,,None, 46,ambulatory,,None,, 46,ambulatory,,None,None, +46,ambulatory,None,,, +46,ambulatory,None,,None, +46,ambulatory,None,None,, +46,ambulatory,None,None,None, 26,,,,,2018-07-01 26,,,,None,2018-07-01 26,,,None,,2018-07-01 26,,,None,None,2018-07-01 +26,,None,,,2018-07-01 +26,,None,,None,2018-07-01 +26,,None,None,,2018-07-01 +26,,None,None,None,2018-07-01 24,,,,,2018-06-01 24,,,,None,2018-06-01 24,,,None,,2018-06-01 24,,,None,None,2018-06-01 +24,,None,,,2018-06-01 +24,,None,,None,2018-06-01 +24,,None,None,,2018-06-01 +24,,None,None,None,2018-06-01 24,ambulatory,,,,2018-07-01 24,ambulatory,,,None,2018-07-01 24,ambulatory,,None,,2018-07-01 24,ambulatory,,None,None,2018-07-01 +24,ambulatory,None,,,2018-07-01 +24,ambulatory,None,,None,2018-07-01 +24,ambulatory,None,None,,2018-07-01 +24,ambulatory,None,None,None,2018-07-01 22,ambulatory,,,,2018-06-01 22,ambulatory,,,None,2018-06-01 22,ambulatory,,None,,2018-06-01 22,ambulatory,,None,None,2018-06-01 +22,ambulatory,None,,,2018-06-01 +22,ambulatory,None,,None,2018-06-01 +22,ambulatory,None,None,,2018-06-01 +22,ambulatory,None,None,None,2018-06-01 diff --git a/tests/test_discovery.py b/tests/test_discovery.py new file mode 100644 index 00000000..b0984962 --- /dev/null +++ b/tests/test_discovery.py @@ -0,0 +1,64 @@ +import os +import pathlib +from unittest import mock + +from cumulus_library import cli, databases +from tests import conftest + + +@mock.patch.dict( + os.environ, + clear=True, +) +def test_discovery(tmp_path): + cli.main( + cli_args=conftest.duckdb_args( + [ + "build", + "-t", + "core", + "-s", + "./tests/test_data", + "--database", + "test", + ], + tmp_path, + ) + ) + cli.main( + cli_args=conftest.duckdb_args( + [ + "build", + "-t", + "discovery", + "-s", + "./tests/test_data", + "--database", + f"{tmp_path}/duck.db", + ], + tmp_path, + ) + ) + db = databases.DuckDatabaseBackend(f"{tmp_path}/duck.db") + cursor = db.cursor() + table_rows = conftest.get_sorted_table_data(cursor, "discovery__code_sources") + + # For regenerating test data + with open( + f"{pathlib.Path(__file__).resolve().parents[0]}" + "/test_data/discovery/discovery__code_sources.txt", + "w", + ) as f: + for row in table_rows: + f.write(f"{','.join(str(x) for x in row)}\n") + + with open( + f"{pathlib.Path(__file__).resolve().parents[0]}" + "/test_data/discovery/discovery__code_sources.txt", + ) as ref: + for row in ref: + ref_row = row.rstrip().split(",") + for pos in range(0, len(ref_row)): + if ref_row[pos] == "None": + ref_row[pos] = None + assert tuple(ref_row) in table_rows diff --git a/tests/test_duckdb.py b/tests/test_duckdb.py index 2db351c7..3c68c32b 100644 --- a/tests/test_duckdb.py +++ b/tests/test_duckdb.py @@ -18,40 +18,36 @@ os.environ, clear=True, ) -def test_duckdb_core_build_and_export(): +def test_duckdb_core_build_and_export(tmp_path): data_dir = f"{Path(__file__).parent}/test_data/duckdb_data" + cli.main( + [ + "build", + "--target=core", + "--db-type=duckdb", + f"--database={tmp_path}/duck.db", + f"--load-ndjson-dir={data_dir}", + ] + ) + cli.main( + [ + "export", + "--target=core", + "--db-type=duckdb", + f"--database={tmp_path}/duck.db", + f"{tmp_path}/counts", + ] + ) - with tempfile.TemporaryDirectory() as tmpdir: - cli.main( - [ - "build", - "--target=core", - "--db-type=duckdb", - f"--database={tmpdir}/duck.db", - f"--load-ndjson-dir={data_dir}", - ] - ) - cli.main( - [ - "export", - "--target=core", - "--db-type=duckdb", - f"--database={tmpdir}/duck.db", - f"{tmpdir}/counts", - ] - ) - - # Now check each csv file - we'll assume the parquest are alright - csv_files = glob.glob(f"{tmpdir}/counts/core/*.csv") - for csv_file in csv_files: - basename = Path(csv_file).name - with open(csv_file, encoding="utf8") as f: - generated = f.read().strip() - with open( - f"{data_dir}/expected_export/core/{basename}", encoding="utf8" - ) as f: - expected = f.read().strip() - assert generated == expected, basename + # Now check each csv file - we'll assume the parquest are alright + csv_files = glob.glob(f"{tmp_path}/counts/core/*.csv") + for csv_file in csv_files: + basename = Path(csv_file).name + with open(csv_file, encoding="utf8") as f: + generated = f.read().strip() + with open(f"{data_dir}/expected_export/core/{basename}", encoding="utf8") as f: + expected = f.read().strip() + assert generated == expected, basename @pytest.mark.parametrize( diff --git a/tests/test_template_sql_utils.py b/tests/test_template_sql_utils.py index 2136cc9c..4f8be574 100644 --- a/tests/test_template_sql_utils.py +++ b/tests/test_template_sql_utils.py @@ -8,63 +8,39 @@ @pytest.mark.parametrize( - "table,base_col,expected,raises", + "table,hierarchy,expected,returns,raises", [ # coding - ("condition", "code", True, does_not_raise()), + ("condition", [("code", dict), ("coding", list)], None, True, does_not_raise()), # array coding - ("condition", "category", False, does_not_raise()), + ( + "condition", + [("category", list), ("coding", list)], + None, + True, + does_not_raise(), + ), # bare code - ("encounter", "class", False, does_not_raise()), + ( + "encounter", + [("class", dict)], + ["code", "system", "display"], + True, + does_not_raise(), + ), # non coding - ("condition", "resourcetype", False, does_not_raise()), + ("encounter", [("period", dict)], None, False, does_not_raise()), + # non coding with specific expected fields + ("encounter", [("period", dict)], ["start", "end"], True, does_not_raise()), ], ) -def test_is_codeable_concept_populated(mock_db, table, base_col, expected, raises): +def test_is_field_populated(mock_db, table, hierarchy, expected, returns, raises): with raises: - res = sql_utils.is_codeable_concept_populated( - "main", table, base_col, mock_db.cursor() + res = sql_utils.is_field_populated( + schema="main", + source_table=table, + hierarchy=hierarchy, + expected=expected, + cursor=mock_db.cursor(), ) - assert res == expected - - -@pytest.mark.parametrize( - "table,base_col,expected,raises", - [ - # coding - ("condition", "code", False, does_not_raise()), - # array coding - ("condition", "category", True, does_not_raise()), - # bare code - ("encounter", "status", False, does_not_raise()), - # non coding - ("condition", "resourcetype", False, does_not_raise()), - ], -) -def test_is_codeable_concept_array_populated( - mock_db, table, base_col, expected, raises -): - with raises: - res = sql_utils.is_codeable_concept_array_populated( - "main", table, base_col, mock_db.cursor() - ) - assert res == expected - - -@pytest.mark.parametrize( - "table,base_col,expected,raises", - [ - # coding - ("condition", "code", False, does_not_raise()), - # array coding - ("condition", "category", False, does_not_raise()), - # bare code - ("encounter", "class", True, does_not_raise()), - # non coding - ("condition", "resourcetype", False, does_not_raise()), - ], -) -def test_is_code_populated(mock_db, table, base_col, expected, raises): - with raises: - res = sql_utils.is_code_populated("main", table, base_col, mock_db.cursor()) - assert res == expected + assert res == returns diff --git a/tests/test_templates.py b/tests/test_templates.py index e4401f0a..55a32418 100644 --- a/tests/test_templates.py +++ b/tests/test_templates.py @@ -354,22 +354,22 @@ def test_extension_denormalize_creation(): WHERE available_priority = 1 );""" config = sql_utils.ExtensionConfig( - "source_table", - "source_id", - "target_table", - "prefix", - "fhir_extension", - ["omb", "text"], + source_table="source_table", + source_id="source_id", + target_table="target_table", + target_col_prefix="prefix", + fhir_extension="fhir_extension", + ext_systems=["omb", "text"], ) query = base_templates.get_extension_denormalize_query(config) assert query == expected config = sql_utils.ExtensionConfig( - "source_table", - "source_id", - "target_table", - "prefix", - "fhir_extension", - ["omb", "text"], + source_table="source_table", + source_id="source_id", + target_table="target_table", + target_col_prefix="prefix", + fhir_extension="fhir_extension", + ext_systems=["omb", "text"], is_array=True, ) query = base_templates.get_extension_denormalize_query(config) @@ -503,13 +503,11 @@ def test_get_code_system_pairs(): SELECT * FROM ( VALUES ( - ( - 'empty', - 'empty', - '', - '', - '' - ) + 'empty', + 'empty', + '', + '', + '' ) ) AS t (table_name, column_name, code, display, system)""" From dae38e390ce5445cd26e8102f9e831f6216cc9a7 Mon Sep 17 00:00:00 2001 From: Matt Garber Date: Thu, 21 Mar 2024 10:21:15 -0400 Subject: [PATCH 2/8] column hierarchy rework --- .../studies/core/builder_condition.py | 6 +- .../studies/core/builder_documentreference.py | 10 +- .../studies/core/builder_encounter.py | 20 +- .../studies/core/builder_medicationrequest.py | 6 +- .../studies/core/builder_observation.py | 14 +- .../core/reference_sql/builder_condition.sql | 56 ++--- .../builder_documentreference.sql | 41 +--- .../core/reference_sql/builder_encounter.sql | 141 +++++++----- .../builder_medicationrequest.sql | 78 +++---- .../reference_sql/builder_observation.sql | 21 +- .../template_sql/base_templates.py | 12 +- .../codeable_concept_denormalize.sql.jinja | 11 + cumulus_library/template_sql/sql_utils.py | 72 ++++--- .../core/core__count_encounter_type_month.txt | 24 --- .../core/core__documentreference.txt | 204 +++++++++--------- tests/test_data/core/core__encounter.txt | 36 ++-- tests/test_data/core/core__encounter_type.txt | 100 ++++----- .../encounters.arbitrary.name.ndjson | 2 +- .../core__count_encounter_enc_type_month.csv | 6 - .../core/core__count_encounter_type.csv | 8 - .../core/core__count_encounter_type_month.csv | 24 --- tests/test_duckdb.py | 1 + tests/test_templates.py | 8 +- 23 files changed, 435 insertions(+), 466 deletions(-) diff --git a/cumulus_library/studies/core/builder_condition.py b/cumulus_library/studies/core/builder_condition.py index 0602973c..d94ecbfb 100644 --- a/cumulus_library/studies/core/builder_condition.py +++ b/cumulus_library/studies/core/builder_condition.py @@ -46,8 +46,7 @@ def denormalize_codes(self): preferred_config = sql_utils.CodeableConceptConfig( source_table="condition", source_id="id", - column_name="code", - is_array=False, + column_hierarchy=[("code", dict)], target_table="core__condition_codable_concepts_display", filter_priority=True, code_systems=[ @@ -69,8 +68,7 @@ def denormalize_codes(self): all_config = sql_utils.CodeableConceptConfig( source_table="condition", source_id="id", - column_name="code", - is_array=False, + column_hierarchy=[("code", dict)], target_table="core__condition_codable_concepts_all", filter_priority=False, ) diff --git a/cumulus_library/studies/core/builder_documentreference.py b/cumulus_library/studies/core/builder_documentreference.py index 44054adc..60259684 100644 --- a/cumulus_library/studies/core/builder_documentreference.py +++ b/cumulus_library/studies/core/builder_documentreference.py @@ -33,8 +33,7 @@ def prepare_queries( sql_utils.CodeableConceptConfig( source_table="documentreference", source_id="id", - column_name="type", - is_array=False, + column_hierarchy=[("type", dict)], target_table="core__documentreference_dn_type", ), # TODO: The US core profile allows an extensible code for category, but @@ -47,8 +46,7 @@ def prepare_queries( sql_utils.CodeableConceptConfig( source_table="documentreference", source_id="id", - column_name="category", - is_array=True, + column_hierarchy=[("category", list)], filter_priority=True, target_table="core__documentreference_dn_category", code_systems=[ @@ -58,9 +56,7 @@ def prepare_queries( sql_utils.CodingConfig( source_table="documentreference", source_id="id", - column_name="format", - parent_field="content", - is_array=False, + column_hierarchy=[("format", dict), ("content", dict)], target_table="core__documentreference_dn_format", ), ], diff --git a/cumulus_library/studies/core/builder_encounter.py b/cumulus_library/studies/core/builder_encounter.py index fb5a1bf0..8c90ac79 100644 --- a/cumulus_library/studies/core/builder_encounter.py +++ b/cumulus_library/studies/core/builder_encounter.py @@ -35,7 +35,7 @@ class EncConfig(sql_utils.CodeableConceptConfig): source_table: str = "encounter" def __post_init__(self): - self.target_table = f"core__encounter_dn_{self.column_name.split('.')[-1]}" + self.target_table = f"core__encounter_dn_{self.column_hierarchy[-1][0]}" class CoreEncounterBuilder(base_table_builder.BaseTableBuilder): @@ -44,8 +44,7 @@ class CoreEncounterBuilder(base_table_builder.BaseTableBuilder): def denormalize_codes(self, schema, cursor): code_configs = [ EncConfig( - column_name="type", - is_array=True, + column_hierarchy=[("type", list)], filter_priority=True, code_systems=[ "http://terminology.hl7.org/CodeSystem/encounter-type", @@ -62,8 +61,7 @@ def denormalize_codes(self, schema, cursor): ], ), EncConfig( - column_name="servicetype", - is_array=False, + column_hierarchy=[("servicetype", dict)], filter_priority=True, code_systems=[ "http://terminology.hl7.org/CodeSystem/service-type", @@ -76,8 +74,7 @@ def denormalize_codes(self, schema, cursor): ], ), EncConfig( - column_name="priority", - is_array=False, + column_hierarchy=[("priority", dict)], filter_priority=True, code_systems=[ "http://terminology.hl7.org/CodeSystem/v3-ActPriority", @@ -89,8 +86,7 @@ def denormalize_codes(self, schema, cursor): ], ), EncConfig( - column_name="reasoncode", - is_array=True, + column_hierarchy=[("reasoncode", list)], filter_priority=True, code_systems=[ "http://terminology.hl7.org/CodeSystem/v3-ActPriority", @@ -104,8 +100,10 @@ def denormalize_codes(self, schema, cursor): ], ), EncConfig( - column_name="hospitalization.dischargedisposition", - is_array=False, + column_hierarchy=[ + ("hospitalization", dict), + ("dischargedisposition", dict), + ], filter_priority=False, ), ] diff --git a/cumulus_library/studies/core/builder_medicationrequest.py b/cumulus_library/studies/core/builder_medicationrequest.py index 036e22f0..e5892026 100644 --- a/cumulus_library/studies/core/builder_medicationrequest.py +++ b/cumulus_library/studies/core/builder_medicationrequest.py @@ -43,15 +43,13 @@ def prepare_queries( sql_utils.CodeableConceptConfig( source_table="medicationrequest", source_id="id", - column_name="category", - is_array=True, + column_hierarchy=[("category", list)], target_table="core__medicationrequest_dn_category", ), sql_utils.CodeableConceptConfig( source_table="medicationrequest", source_id="id", - column_name="medicationcodeableconcept", - is_array=False, + column_hierarchy=[("medicationcodeableconcept", dict)], target_table="core__medicationrequest_dn_medication", ), ] diff --git a/cumulus_library/studies/core/builder_observation.py b/cumulus_library/studies/core/builder_observation.py index d0094e35..ad2737c3 100644 --- a/cumulus_library/studies/core/builder_observation.py +++ b/cumulus_library/studies/core/builder_observation.py @@ -37,7 +37,7 @@ class ObsConfig(sql_utils.CodeableConceptConfig): source_table: str = "observation" def __post_init__(self): - self.target_table = f"core__observation_dn_{self.column_name}" + self.target_table = f"core__observation_dn_{self.column_hierarchy[-1][0]}" class ObservationBuilder(base_table_builder.BaseTableBuilder): @@ -57,19 +57,17 @@ def prepare_queries( :param schema: the schema/db name, matching the cursor """ code_sources = [ - ObsConfig(column_name="category", is_array=True, filter_priority=False), - ObsConfig(column_name="code", is_array=False, filter_priority=False), + ObsConfig(column_hierarchy=[("category", list)], filter_priority=False), + ObsConfig(column_hierarchy=[("code", dict)], filter_priority=False), ObsConfig( - column_name="interpretation", is_array=True, filter_priority=False + column_hierarchy=[("interpretation", list)], filter_priority=False ), ObsConfig( - column_name="valuecodeableconcept", - is_array=False, + column_hierarchy=[("valuecodeableconcept", dict)], filter_priority=False, ), ObsConfig( - column_name="dataabsentreason", - is_array=False, + column_hierarchy=[("dataabsentreason", dict)], filter_priority=False, ), ] diff --git a/cumulus_library/studies/core/reference_sql/builder_condition.sql b/cumulus_library/studies/core/reference_sql/builder_condition.sql index 26546bb1..fd86cb05 100644 --- a/cumulus_library/studies/core/reference_sql/builder_condition.sql +++ b/cumulus_library/studies/core/reference_sql/builder_condition.sql @@ -13,11 +13,12 @@ CREATE TABLE core__condition_codable_concepts_display AS ( SELECT DISTINCT s.id AS id, '0' AS priority, - u.codeable_concept.code AS code, - u.codeable_concept.display AS display, + u.codeable_concept.code, + u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - condition AS s, + + condition AS s, UNNEST(s.code.coding) AS u (codeable_concept) WHERE u.codeable_concept.system LIKE 'http://snomed.info/sct' @@ -27,11 +28,12 @@ CREATE TABLE core__condition_codable_concepts_display AS ( SELECT DISTINCT s.id AS id, '1' AS priority, - u.codeable_concept.code AS code, - u.codeable_concept.display AS display, + u.codeable_concept.code, + u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - condition AS s, + + condition AS s, UNNEST(s.code.coding) AS u (codeable_concept) WHERE u.codeable_concept.system LIKE 'http://hl7.org/fhir/sid/icd-10-cm' @@ -41,11 +43,12 @@ CREATE TABLE core__condition_codable_concepts_display AS ( SELECT DISTINCT s.id AS id, '2' AS priority, - u.codeable_concept.code AS code, - u.codeable_concept.display AS display, + u.codeable_concept.code, + u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - condition AS s, + + condition AS s, UNNEST(s.code.coding) AS u (codeable_concept) WHERE u.codeable_concept.system LIKE 'http://hl7.org/fhir/sid/icd-9-cm' @@ -55,11 +58,12 @@ CREATE TABLE core__condition_codable_concepts_display AS ( SELECT DISTINCT s.id AS id, '3' AS priority, - u.codeable_concept.code AS code, - u.codeable_concept.display AS display, + u.codeable_concept.code, + u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - condition AS s, + + condition AS s, UNNEST(s.code.coding) AS u (codeable_concept) WHERE u.codeable_concept.system LIKE 'http://hl7.org/fhir/sid/icd-9-cm/diagnosis' @@ -69,11 +73,12 @@ CREATE TABLE core__condition_codable_concepts_display AS ( SELECT DISTINCT s.id AS id, '4' AS priority, - u.codeable_concept.code AS code, - u.codeable_concept.display AS display, + u.codeable_concept.code, + u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - condition AS s, + + condition AS s, UNNEST(s.code.coding) AS u (codeable_concept) WHERE u.codeable_concept.system LIKE 'urn:oid:1.2.840.114350.1.13.71.2.7.2.728286' @@ -83,11 +88,12 @@ CREATE TABLE core__condition_codable_concepts_display AS ( SELECT DISTINCT s.id AS id, '5' AS priority, - u.codeable_concept.code AS code, - u.codeable_concept.display AS display, + u.codeable_concept.code, + u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - condition AS s, + + condition AS s, UNNEST(s.code.coding) AS u (codeable_concept) WHERE u.codeable_concept.system LIKE 'urn:oid:1.2.840.114350.1.13.71.2.7.4.698084.10375' @@ -97,11 +103,12 @@ CREATE TABLE core__condition_codable_concepts_display AS ( SELECT DISTINCT s.id AS id, '6' AS priority, - u.codeable_concept.code AS code, - u.codeable_concept.display AS display, + u.codeable_concept.code, + u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - condition AS s, + + condition AS s, UNNEST(s.code.coding) AS u (codeable_concept) WHERE u.codeable_concept.system LIKE 'http://terminology.hl7.org/CodeSystem/data-absent-reason' @@ -201,11 +208,12 @@ CREATE TABLE core__condition_codable_concepts_all AS ( system_code_0 AS ( SELECT DISTINCT s.id AS id, - u.codeable_concept.code AS code, - u.codeable_concept.display AS display, + u.codeable_concept.code, + u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - condition AS s, + + condition AS s, UNNEST(s.code.coding) AS u (codeable_concept) ), --noqa: LT07 diff --git a/cumulus_library/studies/core/reference_sql/builder_documentreference.sql b/cumulus_library/studies/core/reference_sql/builder_documentreference.sql index bf07438d..2257ab6c 100644 --- a/cumulus_library/studies/core/reference_sql/builder_documentreference.sql +++ b/cumulus_library/studies/core/reference_sql/builder_documentreference.sql @@ -16,7 +16,8 @@ CREATE TABLE core__documentreference_dn_type AS ( u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - documentreference AS s, + + documentreference AS s, UNNEST(s.type.coding) AS u (codeable_concept) ), --noqa: LT07 @@ -51,7 +52,8 @@ CREATE TABLE core__documentreference_dn_category AS ( u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - documentreference AS s, + + documentreference AS s, UNNEST(s.category) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) WHERE @@ -98,38 +100,15 @@ CREATE TABLE core__documentreference_dn_category AS ( -- ########################################################### -CREATE TABLE core__documentreference_dn_format AS ( - WITH - - system_format_0 AS ( - SELECT DISTINCT - s.id AS id, - u.codeable_concept.code, - u.codeable_concept.display, - u.codeable_concept.system AS code_system - FROM - documentreference AS s, - UNNEST(s.format.coding) AS u (codeable_concept) - ), --noqa: LT07 - - union_table AS ( - SELECT - id, - code_system, - code, - display - FROM system_format_0 - +CREATE TABLE IF NOT EXISTS "main"."core__documentreference_dn_format" +AS ( + SELECT * FROM ( + VALUES + (cast(NULL AS varchar),cast(NULL AS varchar),cast(NULL AS varchar),cast(NULL AS varchar)) ) - SELECT - id, - code, - code_system, - display - FROM union_table + AS t ("id","code","code_system","display") ); - -- ########################################################### diff --git a/cumulus_library/studies/core/reference_sql/builder_encounter.sql b/cumulus_library/studies/core/reference_sql/builder_encounter.sql index 30b9330f..8d54a723 100644 --- a/cumulus_library/studies/core/reference_sql/builder_encounter.sql +++ b/cumulus_library/studies/core/reference_sql/builder_encounter.sql @@ -13,11 +13,12 @@ CREATE TABLE core__encounter_dn_type AS ( SELECT DISTINCT s.id AS id, '0' AS priority, - u.codeable_concept.code AS code, - u.codeable_concept.display AS display, + u.codeable_concept.code, + u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - encounter AS s, + + encounter AS s, UNNEST(s.type) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) WHERE @@ -28,11 +29,12 @@ CREATE TABLE core__encounter_dn_type AS ( SELECT DISTINCT s.id AS id, '1' AS priority, - u.codeable_concept.code AS code, - u.codeable_concept.display AS display, + u.codeable_concept.code, + u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - encounter AS s, + + encounter AS s, UNNEST(s.type) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) WHERE @@ -43,11 +45,12 @@ CREATE TABLE core__encounter_dn_type AS ( SELECT DISTINCT s.id AS id, '2' AS priority, - u.codeable_concept.code AS code, - u.codeable_concept.display AS display, + u.codeable_concept.code, + u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - encounter AS s, + + encounter AS s, UNNEST(s.type) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) WHERE @@ -58,11 +61,12 @@ CREATE TABLE core__encounter_dn_type AS ( SELECT DISTINCT s.id AS id, '3' AS priority, - u.codeable_concept.code AS code, - u.codeable_concept.display AS display, + u.codeable_concept.code, + u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - encounter AS s, + + encounter AS s, UNNEST(s.type) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) WHERE @@ -73,11 +77,12 @@ CREATE TABLE core__encounter_dn_type AS ( SELECT DISTINCT s.id AS id, '4' AS priority, - u.codeable_concept.code AS code, - u.codeable_concept.display AS display, + u.codeable_concept.code, + u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - encounter AS s, + + encounter AS s, UNNEST(s.type) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) WHERE @@ -88,11 +93,12 @@ CREATE TABLE core__encounter_dn_type AS ( SELECT DISTINCT s.id AS id, '5' AS priority, - u.codeable_concept.code AS code, - u.codeable_concept.display AS display, + u.codeable_concept.code, + u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - encounter AS s, + + encounter AS s, UNNEST(s.type) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) WHERE @@ -103,11 +109,12 @@ CREATE TABLE core__encounter_dn_type AS ( SELECT DISTINCT s.id AS id, '6' AS priority, - u.codeable_concept.code AS code, - u.codeable_concept.display AS display, + u.codeable_concept.code, + u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - encounter AS s, + + encounter AS s, UNNEST(s.type) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) WHERE @@ -118,11 +125,12 @@ CREATE TABLE core__encounter_dn_type AS ( SELECT DISTINCT s.id AS id, '7' AS priority, - u.codeable_concept.code AS code, - u.codeable_concept.display AS display, + u.codeable_concept.code, + u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - encounter AS s, + + encounter AS s, UNNEST(s.type) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) WHERE @@ -133,11 +141,12 @@ CREATE TABLE core__encounter_dn_type AS ( SELECT DISTINCT s.id AS id, '8' AS priority, - u.codeable_concept.code AS code, - u.codeable_concept.display AS display, + u.codeable_concept.code, + u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - encounter AS s, + + encounter AS s, UNNEST(s.type) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) WHERE @@ -277,11 +286,12 @@ CREATE TABLE core__encounter_dn_reasoncode AS ( SELECT DISTINCT s.id AS id, '0' AS priority, - u.codeable_concept.code AS code, - u.codeable_concept.display AS display, + u.codeable_concept.code, + u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - encounter AS s, + + encounter AS s, UNNEST(s.reasoncode) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) WHERE @@ -292,11 +302,12 @@ CREATE TABLE core__encounter_dn_reasoncode AS ( SELECT DISTINCT s.id AS id, '1' AS priority, - u.codeable_concept.code AS code, - u.codeable_concept.display AS display, + u.codeable_concept.code, + u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - encounter AS s, + + encounter AS s, UNNEST(s.reasoncode) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) WHERE @@ -307,11 +318,12 @@ CREATE TABLE core__encounter_dn_reasoncode AS ( SELECT DISTINCT s.id AS id, '2' AS priority, - u.codeable_concept.code AS code, - u.codeable_concept.display AS display, + u.codeable_concept.code, + u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - encounter AS s, + + encounter AS s, UNNEST(s.reasoncode) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) WHERE @@ -322,11 +334,12 @@ CREATE TABLE core__encounter_dn_reasoncode AS ( SELECT DISTINCT s.id AS id, '3' AS priority, - u.codeable_concept.code AS code, - u.codeable_concept.display AS display, + u.codeable_concept.code, + u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - encounter AS s, + + encounter AS s, UNNEST(s.reasoncode) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) WHERE @@ -337,11 +350,12 @@ CREATE TABLE core__encounter_dn_reasoncode AS ( SELECT DISTINCT s.id AS id, '4' AS priority, - u.codeable_concept.code AS code, - u.codeable_concept.display AS display, + u.codeable_concept.code, + u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - encounter AS s, + + encounter AS s, UNNEST(s.reasoncode) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) WHERE @@ -352,11 +366,12 @@ CREATE TABLE core__encounter_dn_reasoncode AS ( SELECT DISTINCT s.id AS id, '5' AS priority, - u.codeable_concept.code AS code, - u.codeable_concept.display AS display, + u.codeable_concept.code, + u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - encounter AS s, + + encounter AS s, UNNEST(s.reasoncode) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) WHERE @@ -443,15 +458,39 @@ CREATE TABLE core__encounter_dn_reasoncode AS ( -- ########################################################### -CREATE TABLE IF NOT EXISTS "main"."core__encounter_dn_dischargedisposition" -AS ( - SELECT * FROM ( - VALUES - (cast(NULL AS varchar),cast(NULL AS varchar),cast(NULL AS varchar),cast(NULL AS varchar)) +CREATE TABLE core__encounter_dn_dischargedisposition AS ( + WITH + + system_dischargedisposition_0 AS ( + SELECT DISTINCT + s.id AS id, + u.codeable_concept.code, + u.codeable_concept.display, + u.codeable_concept.system AS code_system + FROM + + encounter AS s, + UNNEST(s.hospitalization.dischargedisposition.coding) AS u (codeable_concept) + ), --noqa: LT07 + + union_table AS ( + SELECT + id, + code_system, + code, + display + FROM system_dischargedisposition_0 + ) - AS t ("id","code","code_system","display") + SELECT + id, + code, + code_system, + display + FROM union_table ); + -- ########################################################### CREATE TABLE core__encounter AS diff --git a/cumulus_library/studies/core/reference_sql/builder_medicationrequest.sql b/cumulus_library/studies/core/reference_sql/builder_medicationrequest.sql index 0eedc6a6..22246657 100644 --- a/cumulus_library/studies/core/reference_sql/builder_medicationrequest.sql +++ b/cumulus_library/studies/core/reference_sql/builder_medicationrequest.sql @@ -12,11 +12,12 @@ CREATE TABLE core__medicationrequest_dn_category AS ( system_category_0 AS ( SELECT DISTINCT s.id AS id, - u.codeable_concept.code AS code, - u.codeable_concept.display AS display, + u.codeable_concept.code, + u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - medicationrequest AS s, + + medicationrequest AS s, UNNEST(s.category) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) ), --noqa: LT07 @@ -41,38 +42,15 @@ CREATE TABLE core__medicationrequest_dn_category AS ( -- ########################################################### -CREATE TABLE core__medicationrequest_dn_medication AS ( - WITH - - system_medicationcodeableconcept_0 AS ( - SELECT DISTINCT - s.id AS id, - u.codeable_concept.code AS code, - u.codeable_concept.display AS display, - u.codeable_concept.system AS code_system - FROM - medicationrequest AS s, - UNNEST(s.medicationcodeableconcept.coding) AS u (codeable_concept) - ), --noqa: LT07 - - union_table AS ( - SELECT - id, - code_system, - code, - display - FROM system_medicationcodeableconcept_0 - +CREATE TABLE IF NOT EXISTS "main"."core__medicationrequest_dn_medication" +AS ( + SELECT * FROM ( + VALUES + (cast(NULL AS varchar),cast(NULL AS varchar),cast(NULL AS varchar),cast(NULL AS varchar)) ) - SELECT - id, - code, - code_system, - display - FROM union_table + AS t ("id","code","code_system","display") ); - -- ########################################################### @@ -88,14 +66,14 @@ WITH temp_mr AS ( AS authoredon_month, cast(NULL as varchar) AS display, mr.reportedboolean, + mr.dosageinstruction, mr.subject.reference AS subject_ref, mr.encounter.reference AS encounter_ref, mrc.code AS category_code, mrc.code_system AS category_code_system, - mrm.code as medication_code, + mrm.code AS medication_code, mrm.code_system AS medication_code_system, - mrm.display AS medication_display, - mr.dosageinstruction + mrm.display AS medication_display FROM medicationrequest AS mr LEFT JOIN core__medicationrequest_dn_category AS mrc ON mr.id = mrc.id LEFT JOIN core__medicationrequest_dn_medication AS mrm ON mr.id = mrm.id @@ -103,19 +81,19 @@ WITH temp_mr AS ( ) SELECT - id, - status, - intent, - category_code, - category_code_system, - reportedboolean, - medication_code_system, - medication_code, - medication_display, - authoredon, - authoredon_month, + mr.id, + mr.status, + mr.intent, + mr.category_code, + mr.category_code_system, + mr.reportedboolean, + mr.medication_code_system, + mr.medication_code, + mr.medication_display, + mr.authoredon, + mr.authoredon_month, dose_row.dose_col.text AS doseageinstruction_text, - subject_ref, - encounter_ref -FROM temp_mr, -UNNEST(dosageinstruction) as dose_row(dose_col) + mr.subject_ref, + mr.encounter_ref +FROM temp_mr AS mr, + UNNEST(dosageinstruction) AS dose_row (dose_col) diff --git a/cumulus_library/studies/core/reference_sql/builder_observation.sql b/cumulus_library/studies/core/reference_sql/builder_observation.sql index 171976b9..b1846364 100644 --- a/cumulus_library/studies/core/reference_sql/builder_observation.sql +++ b/cumulus_library/studies/core/reference_sql/builder_observation.sql @@ -12,11 +12,12 @@ CREATE TABLE core__observation_dn_category AS ( system_category_0 AS ( SELECT DISTINCT s.id AS id, - u.codeable_concept.code AS code, - u.codeable_concept.display AS display, + u.codeable_concept.code, + u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - observation AS s, + + observation AS s, UNNEST(s.category) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) ), --noqa: LT07 @@ -47,11 +48,12 @@ CREATE TABLE core__observation_dn_code AS ( system_code_0 AS ( SELECT DISTINCT s.id AS id, - u.codeable_concept.code AS code, - u.codeable_concept.display AS display, + u.codeable_concept.code, + u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - observation AS s, + + observation AS s, UNNEST(s.code.coding) AS u (codeable_concept) ), --noqa: LT07 @@ -92,11 +94,12 @@ CREATE TABLE core__observation_dn_valuecodeableconcept AS ( system_valuecodeableconcept_0 AS ( SELECT DISTINCT s.id AS id, - u.codeable_concept.code AS code, - u.codeable_concept.display AS display, + u.codeable_concept.code, + u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - observation AS s, + + observation AS s, UNNEST(s.valuecodeableconcept.coding) AS u (codeable_concept) ), --noqa: LT07 diff --git a/cumulus_library/template_sql/base_templates.py b/cumulus_library/template_sql/base_templates.py index a4278b3d..40ad5728 100644 --- a/cumulus_library/template_sql/base_templates.py +++ b/cumulus_library/template_sql/base_templates.py @@ -82,8 +82,11 @@ def get_codeable_concept_denormalize_query( "codeable_concept_denormalize", source_table=config.source_table, source_id=config.source_id, - column_name=config.column_name, - is_array=config.is_array, + column_name=config.column_hierarchy[-1][0], + parent_field=None + if len(config.column_hierarchy) == 1 + else config.column_hierarchy[0][0], + is_array=True if config.column_hierarchy[0][1] == list else False, target_table=config.target_table, filter_priority=config.filter_priority, code_systems=config.code_systems, @@ -112,9 +115,8 @@ def get_coding_denormalize_query( "coding_denormalize", source_table=config.source_table, source_id=config.source_id, - column_name=config.column_name, - parent_field=config.parent_field, - is_array=config.is_array, + column_name=config.column_hierarchy[1][0], + parent_field=config.column_hierarchy[0][0], target_table=config.target_table, filter_priority=config.filter_priority, code_systems=config.code_systems, diff --git a/cumulus_library/template_sql/codeable_concept_denormalize.sql.jinja b/cumulus_library/template_sql/codeable_concept_denormalize.sql.jinja index 15e53498..e9e18dc4 100644 --- a/cumulus_library/template_sql/codeable_concept_denormalize.sql.jinja +++ b/cumulus_library/template_sql/codeable_concept_denormalize.sql.jinja @@ -13,6 +13,16 @@ CREATE TABLE {{ target_table }} AS ( u.codeable_concept.display, u.codeable_concept.system AS code_system FROM + {#- Temp workaround - to be reworked by generic DN -#} + {%- if parent_field != None %} + {{ source_table }} AS s, + {%- if is_array %} + UNNEST(s.{{ parent_field }}) AS parent (parent_row), + UNNEST(parent.parent_row.{{ column_name }}.coding) AS u (codeable_concept) + {%- else %} + UNNEST(s.{{ parent_field }}.{{ column_name }}.coding) AS u (codeable_concept) + {%- endif %} + {%- else %} {{ source_table }} AS s, {%- if is_array %} UNNEST(s.{{ column_name }}) AS cc (cc_row), @@ -20,6 +30,7 @@ CREATE TABLE {{ target_table }} AS ( {%- else %} UNNEST(s.{{ column_name }}.coding) AS u (codeable_concept) {%- endif %} + {%- endif %} {%- if filter_priority %} WHERE u.codeable_concept.system LIKE '{{ system }}' diff --git a/cumulus_library/template_sql/sql_utils.py b/cumulus_library/template_sql/sql_utils.py index f5b93969..af6aadf7 100644 --- a/cumulus_library/template_sql/sql_utils.py +++ b/cumulus_library/template_sql/sql_utils.py @@ -18,21 +18,21 @@ # cutover, possibly tied to a database parser update CODING = ["code", "system", "display"] +CODEABLE_CONCEPT = ["coding", "code", "system", "display"] @dataclass(kw_only=True) -class ComplexObjectConfig(abc.ABC): +class FhirObjectDNConfig(abc.ABC): """ABC for handling table detection/denormalization of objects in SQL""" source_table: str = None source_id: str = "id" target_table: str = None - is_array: bool = False has_data: bool = False @dataclass(kw_only=True) -class CodeableConceptConfig(ComplexObjectConfig): +class CodeableConceptConfig(FhirObjectDNConfig): """Holds parameters for generating codableconcept tables. :param column_name: the column containing the codeableConcept you want to extract. @@ -47,23 +47,22 @@ class CodeableConceptConfig(ComplexObjectConfig): if filter_priority is false. """ - column_name: str + column_hierarchy: list[tuple] filter_priority: bool = False code_systems: list = None - expected: list = field(default_factory=lambda: ["code", "system", "display"]) + expected: list = field(default_factory=lambda: CODEABLE_CONCEPT) @dataclass(kw_only=True) -class CodingConfig(ComplexObjectConfig): - parent_field: str - column_name: str +class CodingConfig(FhirObjectDNConfig): + column_hierarchy: list[tuple] filter_priority: bool = False code_systems: list = None - expected: list = field(default_factory=lambda: ["code", "system", "display"]) + expected: list = field(default_factory=lambda: CODING) @dataclass(kw_only=True) -class ExtensionConfig(ComplexObjectConfig): +class ExtensionConfig(FhirObjectDNConfig): """convenience class for holding parameters for generating extension tables. :param source_table: the table to extract extensions from @@ -78,11 +77,12 @@ class ExtensionConfig(ComplexObjectConfig): target_col_prefix: str fhir_extension: str ext_systems: list[str] + is_array: bool = False def _check_data_in_fields( - schema, - cursor, + schema: str, + cursor: databases.DatabaseCursor, code_sources: list[CodeableConceptConfig], ) -> dict: """checks if CodeableConcept fields actually have data available @@ -116,7 +116,7 @@ def _check_data_in_fields( schema=schema, cursor=cursor, source_table=code_source.source_table, - hierarchy=(("category", list), ("coding", list)), + hierarchy=code_source.column_hierarchy, expected=code_source.expected, ) progress.advance(task) @@ -126,7 +126,7 @@ def _check_data_in_fields( def denormalize_complex_objects( schema: str, cursor: databases.DatabaseCursor, - code_sources: list[ComplexObjectConfig], + code_sources: list[FhirObjectDNConfig], ): queries = [] code_sources = _check_data_in_fields(schema, cursor, code_sources) @@ -171,7 +171,7 @@ def denormalize_complex_objects( def is_field_populated( *, schema: str, - cursor, + cursor: databases.DatabaseCursor, source_table: str, hierarchy: list[tuple], expected: list | None = None, @@ -191,8 +191,8 @@ def is_field_populated( if not _check_schema_if_exists( schema=schema, cursor=cursor, - table=source_table, - base_col=hierarchy[0][0], + source_table=source_table, + source_col=hierarchy[0][0], target_field=hierarchy[-1][0], expected=expected, ): @@ -216,6 +216,11 @@ def is_field_populated( source_field = [last_table_alias, last_row_alias] elif element[1] == dict: source_field.append(element[0]) + else: + raise ValueError( + "sql_utils.is_field_populated: Unexpected type " + f"{element[1]} for field {element[0]}" + ) query = base_templates.get_is_table_not_empty_query( source_table=source_table, field=".".join(source_field), unnests=unnests ) @@ -227,25 +232,42 @@ def is_field_populated( def _check_schema_if_exists( schema: str, - table: str, - base_col: str, - cursor, + cursor: databases.DatabaseCursor, + source_table: str, + source_col: str, target_field: str, expected=None, - check_missing: bool = False, ) -> bool: - """Validation check for a column existing, and having the expected schema""" + """Validation check for a column existing, and having the expected schema + + :param schema: The schema/database name + :param cursor: a PEP-249 compliant database cursor + :param source_table: The table to query against + :param source_col: The column to check the schema against + :param target_field: The name of the nested value to check for inside the + schema of source_col + :param expected: a list of elements that should be present in target_field. + If none, we assume it is a CodeableConcept. + :returns: a boolean indicating if the schema was found. + """ try: - query = base_templates.get_is_table_not_empty_query(table, base_col) + query = base_templates.get_is_table_not_empty_query(source_table, source_col) cursor.execute(query) if cursor.fetchone() is None: return False - query = base_templates.get_column_datatype_query(schema, table, [base_col]) + query = base_templates.get_column_datatype_query( + schema, source_table, [source_col] + ) cursor.execute(query) schema_str = str(cursor.fetchone()[1]) if expected is None: - expected = [target_field, *CODING] + expected = CODEABLE_CONCEPT + # TODO: this naievely checks a column for: + # - containing the target field + # - containing the expected elements + # but it does not check the elements are actually associated with that field. + # This should be revisited once we've got better database parsing logic in place if any(x not in schema_str.lower() for x in expected): return False return True diff --git a/tests/test_data/core/core__count_encounter_type_month.txt b/tests/test_data/core/core__count_encounter_type_month.txt index 58441665..ab0a49d8 100644 --- a/tests/test_data/core/core__count_encounter_type_month.txt +++ b/tests/test_data/core/core__count_encounter_type_month.txt @@ -1,47 +1,23 @@ -(22, 'ambulatory', 'None', 'None', 'None', '2018-06-01') -(22, 'ambulatory', 'None', 'None', None, '2018-06-01') -(22, 'ambulatory', 'None', None, 'None', '2018-06-01') -(22, 'ambulatory', 'None', None, None, '2018-06-01') (22, 'ambulatory', None, 'None', 'None', '2018-06-01') (22, 'ambulatory', None, 'None', None, '2018-06-01') (22, 'ambulatory', None, None, 'None', '2018-06-01') (22, 'ambulatory', None, None, None, '2018-06-01') -(24, 'ambulatory', 'None', 'None', 'None', '2018-07-01') -(24, 'ambulatory', 'None', 'None', None, '2018-07-01') -(24, 'ambulatory', 'None', None, 'None', '2018-07-01') -(24, 'ambulatory', 'None', None, None, '2018-07-01') (24, 'ambulatory', None, 'None', 'None', '2018-07-01') (24, 'ambulatory', None, 'None', None, '2018-07-01') (24, 'ambulatory', None, None, 'None', '2018-07-01') (24, 'ambulatory', None, None, None, '2018-07-01') -(24, None, 'None', 'None', 'None', '2018-06-01') -(24, None, 'None', 'None', None, '2018-06-01') -(24, None, 'None', None, 'None', '2018-06-01') -(24, None, 'None', None, None, '2018-06-01') (24, None, None, 'None', 'None', '2018-06-01') (24, None, None, 'None', None, '2018-06-01') (24, None, None, None, 'None', '2018-06-01') (24, None, None, None, None, '2018-06-01') -(26, None, 'None', 'None', 'None', '2018-07-01') -(26, None, 'None', 'None', None, '2018-07-01') -(26, None, 'None', None, 'None', '2018-07-01') -(26, None, 'None', None, None, '2018-07-01') (26, None, None, 'None', 'None', '2018-07-01') (26, None, None, 'None', None, '2018-07-01') (26, None, None, None, 'None', '2018-07-01') (26, None, None, None, None, '2018-07-01') -(46, 'ambulatory', 'None', 'None', 'None', None) -(46, 'ambulatory', 'None', 'None', None, None) -(46, 'ambulatory', 'None', None, 'None', None) -(46, 'ambulatory', 'None', None, None, None) (46, 'ambulatory', None, 'None', 'None', None) (46, 'ambulatory', None, 'None', None, None) (46, 'ambulatory', None, None, 'None', None) (46, 'ambulatory', None, None, None, None) -(50, None, 'None', 'None', 'None', None) -(50, None, 'None', 'None', None, None) -(50, None, 'None', None, 'None', None) -(50, None, 'None', None, None, None) (50, None, None, 'None', 'None', None) (50, None, None, 'None', None, None) (50, None, None, None, 'None', None) diff --git a/tests/test_data/core/core__documentreference.txt b/tests/test_data/core/core__documentreference.txt index 1b65ef5e..36b460a9 100644 --- a/tests/test_data/core/core__documentreference.txt +++ b/tests/test_data/core/core__documentreference.txt @@ -1,102 +1,102 @@ -('351ea353-4dc6-b0a8-2a70-0e5478e8171e', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/cb8c0665-30ee-479c-8994-d29f1a6848b0', 'Encounter/1d679c3a-2765-5e13-e2a3-4bd76a898fc6', 'DocumentReference/351ea353-4dc6-b0a8-2a70-0e5478e8171e') -('351ea353-4dc6-b0a8-2a70-0e5478e8171e', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/cb8c0665-30ee-479c-8994-d29f1a6848b0', 'Encounter/1d679c3a-2765-5e13-e2a3-4bd76a898fc6', 'DocumentReference/351ea353-4dc6-b0a8-2a70-0e5478e8171e') -('36d0d49a-6346-2856-d614-3f0a1ae85685', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/f9399f0d-5401-09f3-d4ff-89b1aa51b9c8', 'Encounter/6a952afd-3be5-e27e-9e05-5a1e085e34d0', 'DocumentReference/36d0d49a-6346-2856-d614-3f0a1ae85685') -('36d0d49a-6346-2856-d614-3f0a1ae85685', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/f9399f0d-5401-09f3-d4ff-89b1aa51b9c8', 'Encounter/6a952afd-3be5-e27e-9e05-5a1e085e34d0', 'DocumentReference/36d0d49a-6346-2856-d614-3f0a1ae85685') -('37c2d2ba-1976-1167-9bf6-7eb17f3fa35f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/8022fbbe-aaa4-056c-d0f5-ec074bf0656c', 'Encounter/e922a884-7039-a171-a65e-78051fe7afe6', 'DocumentReference/37c2d2ba-1976-1167-9bf6-7eb17f3fa35f') -('37c2d2ba-1976-1167-9bf6-7eb17f3fa35f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/8022fbbe-aaa4-056c-d0f5-ec074bf0656c', 'Encounter/e922a884-7039-a171-a65e-78051fe7afe6', 'DocumentReference/37c2d2ba-1976-1167-9bf6-7eb17f3fa35f') -('3ebf29a1-a116-9d17-5e9a-bad0d6c2d756', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/0b052286-9534-99a8-8d5e-06c2c04a7df7', 'Encounter/e5dabcb6-1d7a-7467-dbba-b864d0d5f5b0', 'DocumentReference/3ebf29a1-a116-9d17-5e9a-bad0d6c2d756') -('3ebf29a1-a116-9d17-5e9a-bad0d6c2d756', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/0b052286-9534-99a8-8d5e-06c2c04a7df7', 'Encounter/e5dabcb6-1d7a-7467-dbba-b864d0d5f5b0', 'DocumentReference/3ebf29a1-a116-9d17-5e9a-bad0d6c2d756') -('3f0e9271-a486-797d-978a-fb2d32d37d47', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 21), datetime.date(2018, 6, 18), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/a46846ca-3f95-2cbb-3a9d-5eae150a0273', 'Encounter/5c3450fb-12f0-08f3-6e4d-8a5e433e19a4', 'DocumentReference/3f0e9271-a486-797d-978a-fb2d32d37d47') -('3f0e9271-a486-797d-978a-fb2d32d37d47', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 21), datetime.date(2018, 6, 18), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/a46846ca-3f95-2cbb-3a9d-5eae150a0273', 'Encounter/5c3450fb-12f0-08f3-6e4d-8a5e433e19a4', 'DocumentReference/3f0e9271-a486-797d-978a-fb2d32d37d47') -('3f578a1b-f50a-9333-3030-306982950658', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/3cf7af45-2bee-aa9c-d524-40b487149d60', 'Encounter/d2782687-6885-037c-957d-579fbd681d2a', 'DocumentReference/3f578a1b-f50a-9333-3030-306982950658') -('3f578a1b-f50a-9333-3030-306982950658', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/3cf7af45-2bee-aa9c-d524-40b487149d60', 'Encounter/d2782687-6885-037c-957d-579fbd681d2a', 'DocumentReference/3f578a1b-f50a-9333-3030-306982950658') -('406679b2-a02c-0003-3b17-56ba373fccff', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/0734762a-9db6-22fc-b595-c3e472bb2a9a', 'Encounter/2f55edb9-a906-0b40-e183-89b1d65d1aa1', 'DocumentReference/406679b2-a02c-0003-3b17-56ba373fccff') -('406679b2-a02c-0003-3b17-56ba373fccff', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/0734762a-9db6-22fc-b595-c3e472bb2a9a', 'Encounter/2f55edb9-a906-0b40-e183-89b1d65d1aa1', 'DocumentReference/406679b2-a02c-0003-3b17-56ba373fccff') -('41eb62dd-7032-e98d-84c6-d494ad8c877b', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, 'final', None, datetime.date(2018, 7, 31), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/2a0e1946-acf6-5a7e-9399-a9cbc4730199', 'Encounter/aabb3ac3-c4a3-f613-9507-63280adb9209', 'DocumentReference/41eb62dd-7032-e98d-84c6-d494ad8c877b') -('41eb62dd-7032-e98d-84c6-d494ad8c877b', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, 'final', None, datetime.date(2018, 7, 31), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/2a0e1946-acf6-5a7e-9399-a9cbc4730199', 'Encounter/aabb3ac3-c4a3-f613-9507-63280adb9209', 'DocumentReference/41eb62dd-7032-e98d-84c6-d494ad8c877b') -('4390dbd1-3bdf-e516-9fe0-a8180181507f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, 'amended', None, datetime.date(2018, 6, 3), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/e80dda2c-a260-dbf7-3167-bf0945f3a91d', 'Encounter/029d1814-d7bf-0624-524d-7ccda5f320f6', 'DocumentReference/4390dbd1-3bdf-e516-9fe0-a8180181507f') -('4390dbd1-3bdf-e516-9fe0-a8180181507f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, 'amended', None, datetime.date(2018, 6, 3), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/e80dda2c-a260-dbf7-3167-bf0945f3a91d', 'Encounter/029d1814-d7bf-0624-524d-7ccda5f320f6', 'DocumentReference/4390dbd1-3bdf-e516-9fe0-a8180181507f') -('4390dbd1-3bdf-e516-9fe0-a8180181507f-error', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, 'entered-in-error', None, datetime.date(2018, 6, 3), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/e80dda2c-a260-dbf7-3167-bf0945f3a91d', 'Encounter/029d1814-d7bf-0624-524d-7ccda5f320f6', 'DocumentReference/4390dbd1-3bdf-e516-9fe0-a8180181507f-error') -('4390dbd1-3bdf-e516-9fe0-a8180181507f-error', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, 'entered-in-error', None, datetime.date(2018, 6, 3), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/e80dda2c-a260-dbf7-3167-bf0945f3a91d', 'Encounter/029d1814-d7bf-0624-524d-7ccda5f320f6', 'DocumentReference/4390dbd1-3bdf-e516-9fe0-a8180181507f-error') -('4439aa6e-fbc2-21a1-208e-095907104a65', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 30), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/82b8a670-4700-30e8-24a0-b83efa3c5e0a', 'Encounter/75b68644-535d-bdc1-4c31-aa9fe7e1822f', 'DocumentReference/4439aa6e-fbc2-21a1-208e-095907104a65') -('4439aa6e-fbc2-21a1-208e-095907104a65', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 30), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/82b8a670-4700-30e8-24a0-b83efa3c5e0a', 'Encounter/75b68644-535d-bdc1-4c31-aa9fe7e1822f', 'DocumentReference/4439aa6e-fbc2-21a1-208e-095907104a65') -('45160ef5-42e8-7239-6633-904308273198', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/3627adb8-f741-acf3-2dd6-10f3bcbe1077', 'Encounter/bca7cabc-b2fc-8a08-c69b-5bc0afa20d80', 'DocumentReference/45160ef5-42e8-7239-6633-904308273198') -('45160ef5-42e8-7239-6633-904308273198', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/3627adb8-f741-acf3-2dd6-10f3bcbe1077', 'Encounter/bca7cabc-b2fc-8a08-c69b-5bc0afa20d80', 'DocumentReference/45160ef5-42e8-7239-6633-904308273198') -('4711ca43-989d-a8f9-5f32-0102640804cf', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/d3c0274f-f42b-8d2b-15f2-82331e723383', 'Encounter/6565ef5c-30b9-8697-6ca6-2b77894d5437', 'DocumentReference/4711ca43-989d-a8f9-5f32-0102640804cf') -('4711ca43-989d-a8f9-5f32-0102640804cf', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/d3c0274f-f42b-8d2b-15f2-82331e723383', 'Encounter/6565ef5c-30b9-8697-6ca6-2b77894d5437', 'DocumentReference/4711ca43-989d-a8f9-5f32-0102640804cf') -('48693636-4eec-ad3d-b71d-8f650bd0a6f1', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/c7ad408d-fcae-b54a-eb1d-26d48f7a5f84', 'Encounter/02eb4e14-1a6f-d968-2c26-c0cf5023afe0', 'DocumentReference/48693636-4eec-ad3d-b71d-8f650bd0a6f1') -('48693636-4eec-ad3d-b71d-8f650bd0a6f1', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/c7ad408d-fcae-b54a-eb1d-26d48f7a5f84', 'Encounter/02eb4e14-1a6f-d968-2c26-c0cf5023afe0', 'DocumentReference/48693636-4eec-ad3d-b71d-8f650bd0a6f1') -('48933dd8-3fcf-416e-89ca-27851e45391f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 29), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/7cef0e6f-9aea-4079-dfc6-18a96454708e', 'Encounter/d735c414-9dd3-c9b1-285c-8da79a7fbbdf', 'DocumentReference/48933dd8-3fcf-416e-89ca-27851e45391f') -('48933dd8-3fcf-416e-89ca-27851e45391f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 29), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/7cef0e6f-9aea-4079-dfc6-18a96454708e', 'Encounter/d735c414-9dd3-c9b1-285c-8da79a7fbbdf', 'DocumentReference/48933dd8-3fcf-416e-89ca-27851e45391f') -('4b2e99d5-d4c2-fd1f-a5fd-96fe9546b58a', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/6385ddd7-2639-6505-3789-0521b8f66c8b', 'Encounter/fd0754a4-e96d-cba7-b3c0-77697a09c86e', 'DocumentReference/4b2e99d5-d4c2-fd1f-a5fd-96fe9546b58a') -('4b2e99d5-d4c2-fd1f-a5fd-96fe9546b58a', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/6385ddd7-2639-6505-3789-0521b8f66c8b', 'Encounter/fd0754a4-e96d-cba7-b3c0-77697a09c86e', 'DocumentReference/4b2e99d5-d4c2-fd1f-a5fd-96fe9546b58a') -('99b390f4-1bcb-21ec-85d5-85cbb74e86ae', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/9eaa056b-1efc-0cc8-70ff-62c8f704cc13', 'Encounter/5c994000-aa78-2be5-e6cf-99f230d50c2f', 'DocumentReference/99b390f4-1bcb-21ec-85d5-85cbb74e86ae') -('99b390f4-1bcb-21ec-85d5-85cbb74e86ae', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/9eaa056b-1efc-0cc8-70ff-62c8f704cc13', 'Encounter/5c994000-aa78-2be5-e6cf-99f230d50c2f', 'DocumentReference/99b390f4-1bcb-21ec-85d5-85cbb74e86ae') -('99d49a34-c515-23a1-c3e4-ef73c3cef727', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 26), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/cc9fb8e2-fe52-b72a-aebb-9d10260f121b', 'Encounter/683b04eb-663a-849f-715f-4ccd70bf1524', 'DocumentReference/99d49a34-c515-23a1-c3e4-ef73c3cef727') -('99d49a34-c515-23a1-c3e4-ef73c3cef727', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 26), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/cc9fb8e2-fe52-b72a-aebb-9d10260f121b', 'Encounter/683b04eb-663a-849f-715f-4ccd70bf1524', 'DocumentReference/99d49a34-c515-23a1-c3e4-ef73c3cef727') -('99e26f8b-a5a2-ad5e-713a-16266b5991a1', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/1c498b42-61fd-6341-69c3-053f6e4fe404', 'Encounter/e613f29d-7505-6f2e-a1f5-bfbec300752d', 'DocumentReference/99e26f8b-a5a2-ad5e-713a-16266b5991a1') -('99e26f8b-a5a2-ad5e-713a-16266b5991a1', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/1c498b42-61fd-6341-69c3-053f6e4fe404', 'Encounter/e613f29d-7505-6f2e-a1f5-bfbec300752d', 'DocumentReference/99e26f8b-a5a2-ad5e-713a-16266b5991a1') -('9a50a40a-8099-5ab5-0903-1ba65d8c0905', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/24906e2c-e556-71dc-23d9-3e1d5fb08986', 'Encounter/1154d05c-8727-9373-4224-25b9fdba9ab3', 'DocumentReference/9a50a40a-8099-5ab5-0903-1ba65d8c0905') -('9a50a40a-8099-5ab5-0903-1ba65d8c0905', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/24906e2c-e556-71dc-23d9-3e1d5fb08986', 'Encounter/1154d05c-8727-9373-4224-25b9fdba9ab3', 'DocumentReference/9a50a40a-8099-5ab5-0903-1ba65d8c0905') -('9ca118c6-e354-5588-3cdc-77ee3b3c8711', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/2da1bee2-2bc2-4511-84e1-42860310e2fb', 'Encounter/d5f342b7-017c-f2e7-8697-5a038c91518e', 'DocumentReference/9ca118c6-e354-5588-3cdc-77ee3b3c8711') -('9ca118c6-e354-5588-3cdc-77ee3b3c8711', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/2da1bee2-2bc2-4511-84e1-42860310e2fb', 'Encounter/d5f342b7-017c-f2e7-8697-5a038c91518e', 'DocumentReference/9ca118c6-e354-5588-3cdc-77ee3b3c8711') -('a1b69e45-11f8-a49f-170e-32004c70e842', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 11), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/5ce2e599-fb6e-9b4d-3c2e-87310619b957', 'Encounter/4b03a408-6694-88e3-0e63-3ee464ecd6cd', 'DocumentReference/a1b69e45-11f8-a49f-170e-32004c70e842') -('a1b69e45-11f8-a49f-170e-32004c70e842', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 11), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/5ce2e599-fb6e-9b4d-3c2e-87310619b957', 'Encounter/4b03a408-6694-88e3-0e63-3ee464ecd6cd', 'DocumentReference/a1b69e45-11f8-a49f-170e-32004c70e842') -('a3964c82-0605-c2b2-97dc-0de17a1ec0ef', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 17), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/7f941bcc-e7b2-99e1-585f-129d0ef1c13d', 'Encounter/65f8fdca-a949-80a0-8072-094e9aaee474', 'DocumentReference/a3964c82-0605-c2b2-97dc-0de17a1ec0ef') -('a3964c82-0605-c2b2-97dc-0de17a1ec0ef', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 17), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/7f941bcc-e7b2-99e1-585f-129d0ef1c13d', 'Encounter/65f8fdca-a949-80a0-8072-094e9aaee474', 'DocumentReference/a3964c82-0605-c2b2-97dc-0de17a1ec0ef') -('a5231f35-ad14-580e-1888-55c1b383aa11', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/3ae095ec-8fe0-133b-36d4-8785a6ad8df3', 'Encounter/75312bd2-d5ac-c62e-c9df-0004783725c7', 'DocumentReference/a5231f35-ad14-580e-1888-55c1b383aa11') -('a5231f35-ad14-580e-1888-55c1b383aa11', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/3ae095ec-8fe0-133b-36d4-8785a6ad8df3', 'Encounter/75312bd2-d5ac-c62e-c9df-0004783725c7', 'DocumentReference/a5231f35-ad14-580e-1888-55c1b383aa11') -('a59ca653-b95d-09d2-9fa5-a1b492d85a5f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 28), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/c20e5afd-30df-ac3d-6684-cc29438a9bc4', 'Encounter/b864bcd8-14e0-8bec-b7cc-f8629d91470e', 'DocumentReference/a59ca653-b95d-09d2-9fa5-a1b492d85a5f') -('a59ca653-b95d-09d2-9fa5-a1b492d85a5f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 28), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/c20e5afd-30df-ac3d-6684-cc29438a9bc4', 'Encounter/b864bcd8-14e0-8bec-b7cc-f8629d91470e', 'DocumentReference/a59ca653-b95d-09d2-9fa5-a1b492d85a5f') -('a69150c5-2fbe-2284-1eb5-e11146858a22', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 1), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/9c8d8539-0b1e-73e2-b64f-83f1ea601fa4', 'Encounter/f2752dd7-1bf1-739d-dd8c-40122d0b63bc', 'DocumentReference/a69150c5-2fbe-2284-1eb5-e11146858a22') -('a69150c5-2fbe-2284-1eb5-e11146858a22', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 1), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/9c8d8539-0b1e-73e2-b64f-83f1ea601fa4', 'Encounter/f2752dd7-1bf1-739d-dd8c-40122d0b63bc', 'DocumentReference/a69150c5-2fbe-2284-1eb5-e11146858a22') -('a7115116-f8da-3960-e3ed-f1f0d89646c3', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 2), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/8877ef1f-7cd7-3242-d7f0-73cf3f7165f4', 'Encounter/299b6495-3fe7-8db3-c494-6e1ce8b7986d', 'DocumentReference/a7115116-f8da-3960-e3ed-f1f0d89646c3') -('a7115116-f8da-3960-e3ed-f1f0d89646c3', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 2), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/8877ef1f-7cd7-3242-d7f0-73cf3f7165f4', 'Encounter/299b6495-3fe7-8db3-c494-6e1ce8b7986d', 'DocumentReference/a7115116-f8da-3960-e3ed-f1f0d89646c3') -('a79da4dd-83bc-5b6a-db34-bd35b3acbd2c', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 6), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/19158de4-66a2-f70f-e3bf-4396b312c8f1', 'Encounter/ed151e04-3dd6-8cb7-a3e5-777c8a8667f1', 'DocumentReference/a79da4dd-83bc-5b6a-db34-bd35b3acbd2c') -('a79da4dd-83bc-5b6a-db34-bd35b3acbd2c', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 6), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/19158de4-66a2-f70f-e3bf-4396b312c8f1', 'Encounter/ed151e04-3dd6-8cb7-a3e5-777c8a8667f1', 'DocumentReference/a79da4dd-83bc-5b6a-db34-bd35b3acbd2c') -('a95df5ea-7005-9e98-e97a-1ade6967b585', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 16), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/16be855b-ece2-8b96-1ef9-a4d93adf3289', 'Encounter/83d0d564-3bbf-48eb-7445-bd2b81130671', 'DocumentReference/a95df5ea-7005-9e98-e97a-1ade6967b585') -('a95df5ea-7005-9e98-e97a-1ade6967b585', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 16), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/16be855b-ece2-8b96-1ef9-a4d93adf3289', 'Encounter/83d0d564-3bbf-48eb-7445-bd2b81130671', 'DocumentReference/a95df5ea-7005-9e98-e97a-1ade6967b585') -('a96ba3b7-a461-5849-1881-d372e0460ccc', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 14), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/26a3984f-b2a8-e67f-7abc-ff147a0e6e35', 'Encounter/79d8f213-7847-646b-8a66-5da208cc1c27', 'DocumentReference/a96ba3b7-a461-5849-1881-d372e0460ccc') -('a96ba3b7-a461-5849-1881-d372e0460ccc', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 14), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/26a3984f-b2a8-e67f-7abc-ff147a0e6e35', 'Encounter/79d8f213-7847-646b-8a66-5da208cc1c27', 'DocumentReference/a96ba3b7-a461-5849-1881-d372e0460ccc') -('ac0439bc-e450-d339-da6d-5ead96d8b346', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 30), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/2858705f-5af1-9869-4d94-894e09a9f99a', 'Encounter/de9d67de-6ae3-32f7-20f2-e719ae23a9a3', 'DocumentReference/ac0439bc-e450-d339-da6d-5ead96d8b346') -('ac0439bc-e450-d339-da6d-5ead96d8b346', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 30), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/2858705f-5af1-9869-4d94-894e09a9f99a', 'Encounter/de9d67de-6ae3-32f7-20f2-e719ae23a9a3', 'DocumentReference/ac0439bc-e450-d339-da6d-5ead96d8b346') -('ad2bee76-6e59-5d8b-21ed-b30cdb784198', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 9), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/e455ca3f-fc16-6ffc-297a-adc27e2db183', 'Encounter/98d4bd14-d78e-debb-e7dc-2df7786aedf3', 'DocumentReference/ad2bee76-6e59-5d8b-21ed-b30cdb784198') -('ad2bee76-6e59-5d8b-21ed-b30cdb784198', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 9), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/e455ca3f-fc16-6ffc-297a-adc27e2db183', 'Encounter/98d4bd14-d78e-debb-e7dc-2df7786aedf3', 'DocumentReference/ad2bee76-6e59-5d8b-21ed-b30cdb784198') -('b1f5c114-8e28-08c0-0193-0855aa10c97f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/c7c5c028-f1fb-962b-8db2-dfd4c6d6b02a', 'Encounter/aa890974-162f-5906-dc71-2bb6d2185314', 'DocumentReference/b1f5c114-8e28-08c0-0193-0855aa10c97f') -('b1f5c114-8e28-08c0-0193-0855aa10c97f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/c7c5c028-f1fb-962b-8db2-dfd4c6d6b02a', 'Encounter/aa890974-162f-5906-dc71-2bb6d2185314', 'DocumentReference/b1f5c114-8e28-08c0-0193-0855aa10c97f') -('b2896621-57ef-1ad3-91c5-389dce96973b', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 7), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/ac91b90d-97e4-4fc5-41cd-036bac49e6e8', 'Encounter/dc5ed645-3979-e765-3e03-6ba2173027c3', 'DocumentReference/b2896621-57ef-1ad3-91c5-389dce96973b') -('b2896621-57ef-1ad3-91c5-389dce96973b', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 7), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/ac91b90d-97e4-4fc5-41cd-036bac49e6e8', 'Encounter/dc5ed645-3979-e765-3e03-6ba2173027c3', 'DocumentReference/b2896621-57ef-1ad3-91c5-389dce96973b') -('b3357397-9f4c-7d00-06af-18f03c63d583', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/c1bfec36-dc2c-afc8-c767-3d35ed2bf6f0', 'Encounter/8ff1dc01-5a28-b2d8-3b42-4b7a7d539970', 'DocumentReference/b3357397-9f4c-7d00-06af-18f03c63d583') -('b3357397-9f4c-7d00-06af-18f03c63d583', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/c1bfec36-dc2c-afc8-c767-3d35ed2bf6f0', 'Encounter/8ff1dc01-5a28-b2d8-3b42-4b7a7d539970', 'DocumentReference/b3357397-9f4c-7d00-06af-18f03c63d583') -('b339c2e8-35eb-1838-7eea-5a04c81695df', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/267fc42d-cd9e-8527-1f9e-887fe7776147', 'Encounter/4c4d0730-201f-5b75-c657-8d0de09cc28f', 'DocumentReference/b339c2e8-35eb-1838-7eea-5a04c81695df') -('b339c2e8-35eb-1838-7eea-5a04c81695df', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/267fc42d-cd9e-8527-1f9e-887fe7776147', 'Encounter/4c4d0730-201f-5b75-c657-8d0de09cc28f', 'DocumentReference/b339c2e8-35eb-1838-7eea-5a04c81695df') -('b39532e8-ee15-a7c4-cac5-353a8be67d15', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 8), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/6a883108-7b87-120b-d163-d369336e04e5', 'Encounter/2b1ee164-6c87-420d-a9e2-6c235ebeef71', 'DocumentReference/b39532e8-ee15-a7c4-cac5-353a8be67d15') -('b39532e8-ee15-a7c4-cac5-353a8be67d15', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 8), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/6a883108-7b87-120b-d163-d369336e04e5', 'Encounter/2b1ee164-6c87-420d-a9e2-6c235ebeef71', 'DocumentReference/b39532e8-ee15-a7c4-cac5-353a8be67d15') -('b44d277c-7c09-a39b-97e9-1e96d71b6978', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/7bf52d54-0d2a-265a-15aa-eeed7aaf4af6', 'Encounter/ba84689e-2f9f-7cea-af1f-d69ffdd3a3eb', 'DocumentReference/b44d277c-7c09-a39b-97e9-1e96d71b6978') -('b44d277c-7c09-a39b-97e9-1e96d71b6978', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/7bf52d54-0d2a-265a-15aa-eeed7aaf4af6', 'Encounter/ba84689e-2f9f-7cea-af1f-d69ffdd3a3eb', 'DocumentReference/b44d277c-7c09-a39b-97e9-1e96d71b6978') -('b58f7768-64be-6c0f-1b82-3deffdef1076', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/a28be3e1-a6bd-7df4-fc81-1140848f8453', 'Encounter/91f94a9d-69a7-e30a-cd1a-68c52dc01e70', 'DocumentReference/b58f7768-64be-6c0f-1b82-3deffdef1076') -('b58f7768-64be-6c0f-1b82-3deffdef1076', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/a28be3e1-a6bd-7df4-fc81-1140848f8453', 'Encounter/91f94a9d-69a7-e30a-cd1a-68c52dc01e70', 'DocumentReference/b58f7768-64be-6c0f-1b82-3deffdef1076') -('b73493d0-e2f4-9aa6-cdad-920f7c126d6c', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 16), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/50f8b42e-17a6-e932-8546-da94004c597c', 'Encounter/37604257-be1a-120f-81ee-336f81603f92', 'DocumentReference/b73493d0-e2f4-9aa6-cdad-920f7c126d6c') -('b73493d0-e2f4-9aa6-cdad-920f7c126d6c', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 16), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/50f8b42e-17a6-e932-8546-da94004c597c', 'Encounter/37604257-be1a-120f-81ee-336f81603f92', 'DocumentReference/b73493d0-e2f4-9aa6-cdad-920f7c126d6c') -('b7b68006-53d5-b823-d193-56b262f45e8b', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/ad3ed58a-5645-af0a-eeca-ab543123a8aa', 'Encounter/03e34b19-2889-b828-792d-2a83400c55be', 'DocumentReference/b7b68006-53d5-b823-d193-56b262f45e8b') -('b7b68006-53d5-b823-d193-56b262f45e8b', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/ad3ed58a-5645-af0a-eeca-ab543123a8aa', 'Encounter/03e34b19-2889-b828-792d-2a83400c55be', 'DocumentReference/b7b68006-53d5-b823-d193-56b262f45e8b') -('b953a85f-f18b-d7a3-8974-ba44e0a3141c', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 5), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/a5bc08ea-9462-c4f5-1bd2-ff342598ac99', 'Encounter/f964be66-3fcd-95c8-0021-71c7d24c91b7', 'DocumentReference/b953a85f-f18b-d7a3-8974-ba44e0a3141c') -('b953a85f-f18b-d7a3-8974-ba44e0a3141c', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 5), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/a5bc08ea-9462-c4f5-1bd2-ff342598ac99', 'Encounter/f964be66-3fcd-95c8-0021-71c7d24c91b7', 'DocumentReference/b953a85f-f18b-d7a3-8974-ba44e0a3141c') -('b985a70c-9504-b7b3-0707-f8381ba77976', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/149de67a-2809-59a8-bfa2-36df509021dc', 'Encounter/beb26500-4ccd-ce0a-44f6-74f44be5fafe', 'DocumentReference/b985a70c-9504-b7b3-0707-f8381ba77976') -('b985a70c-9504-b7b3-0707-f8381ba77976', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/149de67a-2809-59a8-bfa2-36df509021dc', 'Encounter/beb26500-4ccd-ce0a-44f6-74f44be5fafe', 'DocumentReference/b985a70c-9504-b7b3-0707-f8381ba77976') -('ba0abbd6-49a9-95fa-2396-7118c56da8c6', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 12), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/9b17654f-a902-3d56-9000-4ade3dd3059f', 'Encounter/ca45bbef-ef2a-3b3c-ea5e-76bcd5865780', 'DocumentReference/ba0abbd6-49a9-95fa-2396-7118c56da8c6') -('ba0abbd6-49a9-95fa-2396-7118c56da8c6', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 12), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/9b17654f-a902-3d56-9000-4ade3dd3059f', 'Encounter/ca45bbef-ef2a-3b3c-ea5e-76bcd5865780', 'DocumentReference/ba0abbd6-49a9-95fa-2396-7118c56da8c6') -('bcbaa9d3-d7cf-3f5f-44d3-32c8a267f991', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/17fde357-dcc9-af8b-a8d3-4bd213afeb22', 'Encounter/32d0ae2d-1be8-9e90-a4da-4c222abd88a9', 'DocumentReference/bcbaa9d3-d7cf-3f5f-44d3-32c8a267f991') -('bcbaa9d3-d7cf-3f5f-44d3-32c8a267f991', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/17fde357-dcc9-af8b-a8d3-4bd213afeb22', 'Encounter/32d0ae2d-1be8-9e90-a4da-4c222abd88a9', 'DocumentReference/bcbaa9d3-d7cf-3f5f-44d3-32c8a267f991') -('bd60a52b-65b9-f26d-03e4-282850509f03', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/51032f44-d514-26e9-3e85-e956561c076e', 'Encounter/d73ed087-e0ae-78e0-7a05-1bac1060c476', 'DocumentReference/bd60a52b-65b9-f26d-03e4-282850509f03') -('bd60a52b-65b9-f26d-03e4-282850509f03', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/51032f44-d514-26e9-3e85-e956561c076e', 'Encounter/d73ed087-e0ae-78e0-7a05-1bac1060c476', 'DocumentReference/bd60a52b-65b9-f26d-03e4-282850509f03') -('bfddb0ff-1296-107e-76ca-14b4a14db9ce', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/26baae20-c8c5-003a-ab6b-ebcc49be20db', 'Encounter/c6ec2350-43d4-abab-2e84-4d2aadb337a7', 'DocumentReference/bfddb0ff-1296-107e-76ca-14b4a14db9ce') -('bfddb0ff-1296-107e-76ca-14b4a14db9ce', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/26baae20-c8c5-003a-ab6b-ebcc49be20db', 'Encounter/c6ec2350-43d4-abab-2e84-4d2aadb337a7', 'DocumentReference/bfddb0ff-1296-107e-76ca-14b4a14db9ce') -('c18dbe84-be31-cee5-1f2e-cf163cdd3e3f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 27), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/a5b171a7-9b28-20e7-86a7-936ecbf55f36', 'Encounter/c4605953-3103-ede6-e0c0-e0588e6f019e', 'DocumentReference/c18dbe84-be31-cee5-1f2e-cf163cdd3e3f') -('c18dbe84-be31-cee5-1f2e-cf163cdd3e3f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 27), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/a5b171a7-9b28-20e7-86a7-936ecbf55f36', 'Encounter/c4605953-3103-ede6-e0c0-e0588e6f019e', 'DocumentReference/c18dbe84-be31-cee5-1f2e-cf163cdd3e3f') -('c6598486-8276-b44a-286e-b376143f7efc', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 25), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/47c37c92-5932-9cfe-66be-208556780fe0', 'Encounter/b5974881-ae62-ddd6-b905-8c86c1ca9e33', 'DocumentReference/c6598486-8276-b44a-286e-b376143f7efc') -('c6598486-8276-b44a-286e-b376143f7efc', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 25), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/47c37c92-5932-9cfe-66be-208556780fe0', 'Encounter/b5974881-ae62-ddd6-b905-8c86c1ca9e33', 'DocumentReference/c6598486-8276-b44a-286e-b376143f7efc') -('c6c64129-9dfa-840d-3309-a5590cc74f2e', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/ad239efc-637c-e428-c829-b87e700d5446', 'Encounter/366df7d3-2ea9-db22-7cdd-60fa8a5c45ca', 'DocumentReference/c6c64129-9dfa-840d-3309-a5590cc74f2e') -('c6c64129-9dfa-840d-3309-a5590cc74f2e', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/ad239efc-637c-e428-c829-b87e700d5446', 'Encounter/366df7d3-2ea9-db22-7cdd-60fa8a5c45ca', 'DocumentReference/c6c64129-9dfa-840d-3309-a5590cc74f2e') -('c84e67e9-4ea8-700b-9f2b-c0179e803d4f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/dffa62dc-8ec2-1cd6-ee75-f9156a5283fe', 'Encounter/11381dc6-0e06-da55-0735-d1e7bbf8bb35', 'DocumentReference/c84e67e9-4ea8-700b-9f2b-c0179e803d4f') -('c84e67e9-4ea8-700b-9f2b-c0179e803d4f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/dffa62dc-8ec2-1cd6-ee75-f9156a5283fe', 'Encounter/11381dc6-0e06-da55-0735-d1e7bbf8bb35', 'DocumentReference/c84e67e9-4ea8-700b-9f2b-c0179e803d4f') +('351ea353-4dc6-b0a8-2a70-0e5478e8171e', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/cb8c0665-30ee-479c-8994-d29f1a6848b0', 'Encounter/1d679c3a-2765-5e13-e2a3-4bd76a898fc6', 'DocumentReference/351ea353-4dc6-b0a8-2a70-0e5478e8171e') +('351ea353-4dc6-b0a8-2a70-0e5478e8171e', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/cb8c0665-30ee-479c-8994-d29f1a6848b0', 'Encounter/1d679c3a-2765-5e13-e2a3-4bd76a898fc6', 'DocumentReference/351ea353-4dc6-b0a8-2a70-0e5478e8171e') +('36d0d49a-6346-2856-d614-3f0a1ae85685', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/f9399f0d-5401-09f3-d4ff-89b1aa51b9c8', 'Encounter/6a952afd-3be5-e27e-9e05-5a1e085e34d0', 'DocumentReference/36d0d49a-6346-2856-d614-3f0a1ae85685') +('36d0d49a-6346-2856-d614-3f0a1ae85685', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/f9399f0d-5401-09f3-d4ff-89b1aa51b9c8', 'Encounter/6a952afd-3be5-e27e-9e05-5a1e085e34d0', 'DocumentReference/36d0d49a-6346-2856-d614-3f0a1ae85685') +('37c2d2ba-1976-1167-9bf6-7eb17f3fa35f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/8022fbbe-aaa4-056c-d0f5-ec074bf0656c', 'Encounter/e922a884-7039-a171-a65e-78051fe7afe6', 'DocumentReference/37c2d2ba-1976-1167-9bf6-7eb17f3fa35f') +('37c2d2ba-1976-1167-9bf6-7eb17f3fa35f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/8022fbbe-aaa4-056c-d0f5-ec074bf0656c', 'Encounter/e922a884-7039-a171-a65e-78051fe7afe6', 'DocumentReference/37c2d2ba-1976-1167-9bf6-7eb17f3fa35f') +('3ebf29a1-a116-9d17-5e9a-bad0d6c2d756', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/0b052286-9534-99a8-8d5e-06c2c04a7df7', 'Encounter/e5dabcb6-1d7a-7467-dbba-b864d0d5f5b0', 'DocumentReference/3ebf29a1-a116-9d17-5e9a-bad0d6c2d756') +('3ebf29a1-a116-9d17-5e9a-bad0d6c2d756', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/0b052286-9534-99a8-8d5e-06c2c04a7df7', 'Encounter/e5dabcb6-1d7a-7467-dbba-b864d0d5f5b0', 'DocumentReference/3ebf29a1-a116-9d17-5e9a-bad0d6c2d756') +('3f0e9271-a486-797d-978a-fb2d32d37d47', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 21), datetime.date(2018, 6, 18), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/a46846ca-3f95-2cbb-3a9d-5eae150a0273', 'Encounter/5c3450fb-12f0-08f3-6e4d-8a5e433e19a4', 'DocumentReference/3f0e9271-a486-797d-978a-fb2d32d37d47') +('3f0e9271-a486-797d-978a-fb2d32d37d47', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 21), datetime.date(2018, 6, 18), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/a46846ca-3f95-2cbb-3a9d-5eae150a0273', 'Encounter/5c3450fb-12f0-08f3-6e4d-8a5e433e19a4', 'DocumentReference/3f0e9271-a486-797d-978a-fb2d32d37d47') +('3f578a1b-f50a-9333-3030-306982950658', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/3cf7af45-2bee-aa9c-d524-40b487149d60', 'Encounter/d2782687-6885-037c-957d-579fbd681d2a', 'DocumentReference/3f578a1b-f50a-9333-3030-306982950658') +('3f578a1b-f50a-9333-3030-306982950658', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/3cf7af45-2bee-aa9c-d524-40b487149d60', 'Encounter/d2782687-6885-037c-957d-579fbd681d2a', 'DocumentReference/3f578a1b-f50a-9333-3030-306982950658') +('406679b2-a02c-0003-3b17-56ba373fccff', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/0734762a-9db6-22fc-b595-c3e472bb2a9a', 'Encounter/2f55edb9-a906-0b40-e183-89b1d65d1aa1', 'DocumentReference/406679b2-a02c-0003-3b17-56ba373fccff') +('406679b2-a02c-0003-3b17-56ba373fccff', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/0734762a-9db6-22fc-b595-c3e472bb2a9a', 'Encounter/2f55edb9-a906-0b40-e183-89b1d65d1aa1', 'DocumentReference/406679b2-a02c-0003-3b17-56ba373fccff') +('41eb62dd-7032-e98d-84c6-d494ad8c877b', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, 'final', None, datetime.date(2018, 7, 31), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/2a0e1946-acf6-5a7e-9399-a9cbc4730199', 'Encounter/aabb3ac3-c4a3-f613-9507-63280adb9209', 'DocumentReference/41eb62dd-7032-e98d-84c6-d494ad8c877b') +('41eb62dd-7032-e98d-84c6-d494ad8c877b', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, 'final', None, datetime.date(2018, 7, 31), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/2a0e1946-acf6-5a7e-9399-a9cbc4730199', 'Encounter/aabb3ac3-c4a3-f613-9507-63280adb9209', 'DocumentReference/41eb62dd-7032-e98d-84c6-d494ad8c877b') +('4390dbd1-3bdf-e516-9fe0-a8180181507f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, 'amended', None, datetime.date(2018, 6, 3), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/e80dda2c-a260-dbf7-3167-bf0945f3a91d', 'Encounter/029d1814-d7bf-0624-524d-7ccda5f320f6', 'DocumentReference/4390dbd1-3bdf-e516-9fe0-a8180181507f') +('4390dbd1-3bdf-e516-9fe0-a8180181507f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, 'amended', None, datetime.date(2018, 6, 3), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/e80dda2c-a260-dbf7-3167-bf0945f3a91d', 'Encounter/029d1814-d7bf-0624-524d-7ccda5f320f6', 'DocumentReference/4390dbd1-3bdf-e516-9fe0-a8180181507f') +('4390dbd1-3bdf-e516-9fe0-a8180181507f-error', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, 'entered-in-error', None, datetime.date(2018, 6, 3), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/e80dda2c-a260-dbf7-3167-bf0945f3a91d', 'Encounter/029d1814-d7bf-0624-524d-7ccda5f320f6', 'DocumentReference/4390dbd1-3bdf-e516-9fe0-a8180181507f-error') +('4390dbd1-3bdf-e516-9fe0-a8180181507f-error', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, 'entered-in-error', None, datetime.date(2018, 6, 3), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/e80dda2c-a260-dbf7-3167-bf0945f3a91d', 'Encounter/029d1814-d7bf-0624-524d-7ccda5f320f6', 'DocumentReference/4390dbd1-3bdf-e516-9fe0-a8180181507f-error') +('4439aa6e-fbc2-21a1-208e-095907104a65', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 30), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/82b8a670-4700-30e8-24a0-b83efa3c5e0a', 'Encounter/75b68644-535d-bdc1-4c31-aa9fe7e1822f', 'DocumentReference/4439aa6e-fbc2-21a1-208e-095907104a65') +('4439aa6e-fbc2-21a1-208e-095907104a65', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 30), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/82b8a670-4700-30e8-24a0-b83efa3c5e0a', 'Encounter/75b68644-535d-bdc1-4c31-aa9fe7e1822f', 'DocumentReference/4439aa6e-fbc2-21a1-208e-095907104a65') +('45160ef5-42e8-7239-6633-904308273198', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/3627adb8-f741-acf3-2dd6-10f3bcbe1077', 'Encounter/bca7cabc-b2fc-8a08-c69b-5bc0afa20d80', 'DocumentReference/45160ef5-42e8-7239-6633-904308273198') +('45160ef5-42e8-7239-6633-904308273198', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/3627adb8-f741-acf3-2dd6-10f3bcbe1077', 'Encounter/bca7cabc-b2fc-8a08-c69b-5bc0afa20d80', 'DocumentReference/45160ef5-42e8-7239-6633-904308273198') +('4711ca43-989d-a8f9-5f32-0102640804cf', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/d3c0274f-f42b-8d2b-15f2-82331e723383', 'Encounter/6565ef5c-30b9-8697-6ca6-2b77894d5437', 'DocumentReference/4711ca43-989d-a8f9-5f32-0102640804cf') +('4711ca43-989d-a8f9-5f32-0102640804cf', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/d3c0274f-f42b-8d2b-15f2-82331e723383', 'Encounter/6565ef5c-30b9-8697-6ca6-2b77894d5437', 'DocumentReference/4711ca43-989d-a8f9-5f32-0102640804cf') +('48693636-4eec-ad3d-b71d-8f650bd0a6f1', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/c7ad408d-fcae-b54a-eb1d-26d48f7a5f84', 'Encounter/02eb4e14-1a6f-d968-2c26-c0cf5023afe0', 'DocumentReference/48693636-4eec-ad3d-b71d-8f650bd0a6f1') +('48693636-4eec-ad3d-b71d-8f650bd0a6f1', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/c7ad408d-fcae-b54a-eb1d-26d48f7a5f84', 'Encounter/02eb4e14-1a6f-d968-2c26-c0cf5023afe0', 'DocumentReference/48693636-4eec-ad3d-b71d-8f650bd0a6f1') +('48933dd8-3fcf-416e-89ca-27851e45391f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 29), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/7cef0e6f-9aea-4079-dfc6-18a96454708e', 'Encounter/d735c414-9dd3-c9b1-285c-8da79a7fbbdf', 'DocumentReference/48933dd8-3fcf-416e-89ca-27851e45391f') +('48933dd8-3fcf-416e-89ca-27851e45391f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 29), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/7cef0e6f-9aea-4079-dfc6-18a96454708e', 'Encounter/d735c414-9dd3-c9b1-285c-8da79a7fbbdf', 'DocumentReference/48933dd8-3fcf-416e-89ca-27851e45391f') +('4b2e99d5-d4c2-fd1f-a5fd-96fe9546b58a', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/6385ddd7-2639-6505-3789-0521b8f66c8b', 'Encounter/fd0754a4-e96d-cba7-b3c0-77697a09c86e', 'DocumentReference/4b2e99d5-d4c2-fd1f-a5fd-96fe9546b58a') +('4b2e99d5-d4c2-fd1f-a5fd-96fe9546b58a', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/6385ddd7-2639-6505-3789-0521b8f66c8b', 'Encounter/fd0754a4-e96d-cba7-b3c0-77697a09c86e', 'DocumentReference/4b2e99d5-d4c2-fd1f-a5fd-96fe9546b58a') +('99b390f4-1bcb-21ec-85d5-85cbb74e86ae', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/9eaa056b-1efc-0cc8-70ff-62c8f704cc13', 'Encounter/5c994000-aa78-2be5-e6cf-99f230d50c2f', 'DocumentReference/99b390f4-1bcb-21ec-85d5-85cbb74e86ae') +('99b390f4-1bcb-21ec-85d5-85cbb74e86ae', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/9eaa056b-1efc-0cc8-70ff-62c8f704cc13', 'Encounter/5c994000-aa78-2be5-e6cf-99f230d50c2f', 'DocumentReference/99b390f4-1bcb-21ec-85d5-85cbb74e86ae') +('99d49a34-c515-23a1-c3e4-ef73c3cef727', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 26), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/cc9fb8e2-fe52-b72a-aebb-9d10260f121b', 'Encounter/683b04eb-663a-849f-715f-4ccd70bf1524', 'DocumentReference/99d49a34-c515-23a1-c3e4-ef73c3cef727') +('99d49a34-c515-23a1-c3e4-ef73c3cef727', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 26), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/cc9fb8e2-fe52-b72a-aebb-9d10260f121b', 'Encounter/683b04eb-663a-849f-715f-4ccd70bf1524', 'DocumentReference/99d49a34-c515-23a1-c3e4-ef73c3cef727') +('99e26f8b-a5a2-ad5e-713a-16266b5991a1', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/1c498b42-61fd-6341-69c3-053f6e4fe404', 'Encounter/e613f29d-7505-6f2e-a1f5-bfbec300752d', 'DocumentReference/99e26f8b-a5a2-ad5e-713a-16266b5991a1') +('99e26f8b-a5a2-ad5e-713a-16266b5991a1', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/1c498b42-61fd-6341-69c3-053f6e4fe404', 'Encounter/e613f29d-7505-6f2e-a1f5-bfbec300752d', 'DocumentReference/99e26f8b-a5a2-ad5e-713a-16266b5991a1') +('9a50a40a-8099-5ab5-0903-1ba65d8c0905', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/24906e2c-e556-71dc-23d9-3e1d5fb08986', 'Encounter/1154d05c-8727-9373-4224-25b9fdba9ab3', 'DocumentReference/9a50a40a-8099-5ab5-0903-1ba65d8c0905') +('9a50a40a-8099-5ab5-0903-1ba65d8c0905', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/24906e2c-e556-71dc-23d9-3e1d5fb08986', 'Encounter/1154d05c-8727-9373-4224-25b9fdba9ab3', 'DocumentReference/9a50a40a-8099-5ab5-0903-1ba65d8c0905') +('9ca118c6-e354-5588-3cdc-77ee3b3c8711', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/2da1bee2-2bc2-4511-84e1-42860310e2fb', 'Encounter/d5f342b7-017c-f2e7-8697-5a038c91518e', 'DocumentReference/9ca118c6-e354-5588-3cdc-77ee3b3c8711') +('9ca118c6-e354-5588-3cdc-77ee3b3c8711', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/2da1bee2-2bc2-4511-84e1-42860310e2fb', 'Encounter/d5f342b7-017c-f2e7-8697-5a038c91518e', 'DocumentReference/9ca118c6-e354-5588-3cdc-77ee3b3c8711') +('a1b69e45-11f8-a49f-170e-32004c70e842', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 11), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/5ce2e599-fb6e-9b4d-3c2e-87310619b957', 'Encounter/4b03a408-6694-88e3-0e63-3ee464ecd6cd', 'DocumentReference/a1b69e45-11f8-a49f-170e-32004c70e842') +('a1b69e45-11f8-a49f-170e-32004c70e842', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 11), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/5ce2e599-fb6e-9b4d-3c2e-87310619b957', 'Encounter/4b03a408-6694-88e3-0e63-3ee464ecd6cd', 'DocumentReference/a1b69e45-11f8-a49f-170e-32004c70e842') +('a3964c82-0605-c2b2-97dc-0de17a1ec0ef', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 17), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/7f941bcc-e7b2-99e1-585f-129d0ef1c13d', 'Encounter/65f8fdca-a949-80a0-8072-094e9aaee474', 'DocumentReference/a3964c82-0605-c2b2-97dc-0de17a1ec0ef') +('a3964c82-0605-c2b2-97dc-0de17a1ec0ef', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 17), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/7f941bcc-e7b2-99e1-585f-129d0ef1c13d', 'Encounter/65f8fdca-a949-80a0-8072-094e9aaee474', 'DocumentReference/a3964c82-0605-c2b2-97dc-0de17a1ec0ef') +('a5231f35-ad14-580e-1888-55c1b383aa11', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/3ae095ec-8fe0-133b-36d4-8785a6ad8df3', 'Encounter/75312bd2-d5ac-c62e-c9df-0004783725c7', 'DocumentReference/a5231f35-ad14-580e-1888-55c1b383aa11') +('a5231f35-ad14-580e-1888-55c1b383aa11', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/3ae095ec-8fe0-133b-36d4-8785a6ad8df3', 'Encounter/75312bd2-d5ac-c62e-c9df-0004783725c7', 'DocumentReference/a5231f35-ad14-580e-1888-55c1b383aa11') +('a59ca653-b95d-09d2-9fa5-a1b492d85a5f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 28), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/c20e5afd-30df-ac3d-6684-cc29438a9bc4', 'Encounter/b864bcd8-14e0-8bec-b7cc-f8629d91470e', 'DocumentReference/a59ca653-b95d-09d2-9fa5-a1b492d85a5f') +('a59ca653-b95d-09d2-9fa5-a1b492d85a5f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 28), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/c20e5afd-30df-ac3d-6684-cc29438a9bc4', 'Encounter/b864bcd8-14e0-8bec-b7cc-f8629d91470e', 'DocumentReference/a59ca653-b95d-09d2-9fa5-a1b492d85a5f') +('a69150c5-2fbe-2284-1eb5-e11146858a22', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 1), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/9c8d8539-0b1e-73e2-b64f-83f1ea601fa4', 'Encounter/f2752dd7-1bf1-739d-dd8c-40122d0b63bc', 'DocumentReference/a69150c5-2fbe-2284-1eb5-e11146858a22') +('a69150c5-2fbe-2284-1eb5-e11146858a22', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 1), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/9c8d8539-0b1e-73e2-b64f-83f1ea601fa4', 'Encounter/f2752dd7-1bf1-739d-dd8c-40122d0b63bc', 'DocumentReference/a69150c5-2fbe-2284-1eb5-e11146858a22') +('a7115116-f8da-3960-e3ed-f1f0d89646c3', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 2), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/8877ef1f-7cd7-3242-d7f0-73cf3f7165f4', 'Encounter/299b6495-3fe7-8db3-c494-6e1ce8b7986d', 'DocumentReference/a7115116-f8da-3960-e3ed-f1f0d89646c3') +('a7115116-f8da-3960-e3ed-f1f0d89646c3', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 2), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/8877ef1f-7cd7-3242-d7f0-73cf3f7165f4', 'Encounter/299b6495-3fe7-8db3-c494-6e1ce8b7986d', 'DocumentReference/a7115116-f8da-3960-e3ed-f1f0d89646c3') +('a79da4dd-83bc-5b6a-db34-bd35b3acbd2c', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 6), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/19158de4-66a2-f70f-e3bf-4396b312c8f1', 'Encounter/ed151e04-3dd6-8cb7-a3e5-777c8a8667f1', 'DocumentReference/a79da4dd-83bc-5b6a-db34-bd35b3acbd2c') +('a79da4dd-83bc-5b6a-db34-bd35b3acbd2c', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 6), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/19158de4-66a2-f70f-e3bf-4396b312c8f1', 'Encounter/ed151e04-3dd6-8cb7-a3e5-777c8a8667f1', 'DocumentReference/a79da4dd-83bc-5b6a-db34-bd35b3acbd2c') +('a95df5ea-7005-9e98-e97a-1ade6967b585', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 16), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/16be855b-ece2-8b96-1ef9-a4d93adf3289', 'Encounter/83d0d564-3bbf-48eb-7445-bd2b81130671', 'DocumentReference/a95df5ea-7005-9e98-e97a-1ade6967b585') +('a95df5ea-7005-9e98-e97a-1ade6967b585', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 16), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/16be855b-ece2-8b96-1ef9-a4d93adf3289', 'Encounter/83d0d564-3bbf-48eb-7445-bd2b81130671', 'DocumentReference/a95df5ea-7005-9e98-e97a-1ade6967b585') +('a96ba3b7-a461-5849-1881-d372e0460ccc', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 14), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/26a3984f-b2a8-e67f-7abc-ff147a0e6e35', 'Encounter/79d8f213-7847-646b-8a66-5da208cc1c27', 'DocumentReference/a96ba3b7-a461-5849-1881-d372e0460ccc') +('a96ba3b7-a461-5849-1881-d372e0460ccc', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 14), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/26a3984f-b2a8-e67f-7abc-ff147a0e6e35', 'Encounter/79d8f213-7847-646b-8a66-5da208cc1c27', 'DocumentReference/a96ba3b7-a461-5849-1881-d372e0460ccc') +('ac0439bc-e450-d339-da6d-5ead96d8b346', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 30), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/2858705f-5af1-9869-4d94-894e09a9f99a', 'Encounter/de9d67de-6ae3-32f7-20f2-e719ae23a9a3', 'DocumentReference/ac0439bc-e450-d339-da6d-5ead96d8b346') +('ac0439bc-e450-d339-da6d-5ead96d8b346', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 30), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/2858705f-5af1-9869-4d94-894e09a9f99a', 'Encounter/de9d67de-6ae3-32f7-20f2-e719ae23a9a3', 'DocumentReference/ac0439bc-e450-d339-da6d-5ead96d8b346') +('ad2bee76-6e59-5d8b-21ed-b30cdb784198', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 9), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/e455ca3f-fc16-6ffc-297a-adc27e2db183', 'Encounter/98d4bd14-d78e-debb-e7dc-2df7786aedf3', 'DocumentReference/ad2bee76-6e59-5d8b-21ed-b30cdb784198') +('ad2bee76-6e59-5d8b-21ed-b30cdb784198', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 9), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/e455ca3f-fc16-6ffc-297a-adc27e2db183', 'Encounter/98d4bd14-d78e-debb-e7dc-2df7786aedf3', 'DocumentReference/ad2bee76-6e59-5d8b-21ed-b30cdb784198') +('b1f5c114-8e28-08c0-0193-0855aa10c97f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/c7c5c028-f1fb-962b-8db2-dfd4c6d6b02a', 'Encounter/aa890974-162f-5906-dc71-2bb6d2185314', 'DocumentReference/b1f5c114-8e28-08c0-0193-0855aa10c97f') +('b1f5c114-8e28-08c0-0193-0855aa10c97f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/c7c5c028-f1fb-962b-8db2-dfd4c6d6b02a', 'Encounter/aa890974-162f-5906-dc71-2bb6d2185314', 'DocumentReference/b1f5c114-8e28-08c0-0193-0855aa10c97f') +('b2896621-57ef-1ad3-91c5-389dce96973b', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 7), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/ac91b90d-97e4-4fc5-41cd-036bac49e6e8', 'Encounter/dc5ed645-3979-e765-3e03-6ba2173027c3', 'DocumentReference/b2896621-57ef-1ad3-91c5-389dce96973b') +('b2896621-57ef-1ad3-91c5-389dce96973b', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 7), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/ac91b90d-97e4-4fc5-41cd-036bac49e6e8', 'Encounter/dc5ed645-3979-e765-3e03-6ba2173027c3', 'DocumentReference/b2896621-57ef-1ad3-91c5-389dce96973b') +('b3357397-9f4c-7d00-06af-18f03c63d583', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/c1bfec36-dc2c-afc8-c767-3d35ed2bf6f0', 'Encounter/8ff1dc01-5a28-b2d8-3b42-4b7a7d539970', 'DocumentReference/b3357397-9f4c-7d00-06af-18f03c63d583') +('b3357397-9f4c-7d00-06af-18f03c63d583', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/c1bfec36-dc2c-afc8-c767-3d35ed2bf6f0', 'Encounter/8ff1dc01-5a28-b2d8-3b42-4b7a7d539970', 'DocumentReference/b3357397-9f4c-7d00-06af-18f03c63d583') +('b339c2e8-35eb-1838-7eea-5a04c81695df', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/267fc42d-cd9e-8527-1f9e-887fe7776147', 'Encounter/4c4d0730-201f-5b75-c657-8d0de09cc28f', 'DocumentReference/b339c2e8-35eb-1838-7eea-5a04c81695df') +('b339c2e8-35eb-1838-7eea-5a04c81695df', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/267fc42d-cd9e-8527-1f9e-887fe7776147', 'Encounter/4c4d0730-201f-5b75-c657-8d0de09cc28f', 'DocumentReference/b339c2e8-35eb-1838-7eea-5a04c81695df') +('b39532e8-ee15-a7c4-cac5-353a8be67d15', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 8), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/6a883108-7b87-120b-d163-d369336e04e5', 'Encounter/2b1ee164-6c87-420d-a9e2-6c235ebeef71', 'DocumentReference/b39532e8-ee15-a7c4-cac5-353a8be67d15') +('b39532e8-ee15-a7c4-cac5-353a8be67d15', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 8), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/6a883108-7b87-120b-d163-d369336e04e5', 'Encounter/2b1ee164-6c87-420d-a9e2-6c235ebeef71', 'DocumentReference/b39532e8-ee15-a7c4-cac5-353a8be67d15') +('b44d277c-7c09-a39b-97e9-1e96d71b6978', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/7bf52d54-0d2a-265a-15aa-eeed7aaf4af6', 'Encounter/ba84689e-2f9f-7cea-af1f-d69ffdd3a3eb', 'DocumentReference/b44d277c-7c09-a39b-97e9-1e96d71b6978') +('b44d277c-7c09-a39b-97e9-1e96d71b6978', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/7bf52d54-0d2a-265a-15aa-eeed7aaf4af6', 'Encounter/ba84689e-2f9f-7cea-af1f-d69ffdd3a3eb', 'DocumentReference/b44d277c-7c09-a39b-97e9-1e96d71b6978') +('b58f7768-64be-6c0f-1b82-3deffdef1076', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/a28be3e1-a6bd-7df4-fc81-1140848f8453', 'Encounter/91f94a9d-69a7-e30a-cd1a-68c52dc01e70', 'DocumentReference/b58f7768-64be-6c0f-1b82-3deffdef1076') +('b58f7768-64be-6c0f-1b82-3deffdef1076', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/a28be3e1-a6bd-7df4-fc81-1140848f8453', 'Encounter/91f94a9d-69a7-e30a-cd1a-68c52dc01e70', 'DocumentReference/b58f7768-64be-6c0f-1b82-3deffdef1076') +('b73493d0-e2f4-9aa6-cdad-920f7c126d6c', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 16), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/50f8b42e-17a6-e932-8546-da94004c597c', 'Encounter/37604257-be1a-120f-81ee-336f81603f92', 'DocumentReference/b73493d0-e2f4-9aa6-cdad-920f7c126d6c') +('b73493d0-e2f4-9aa6-cdad-920f7c126d6c', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 16), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/50f8b42e-17a6-e932-8546-da94004c597c', 'Encounter/37604257-be1a-120f-81ee-336f81603f92', 'DocumentReference/b73493d0-e2f4-9aa6-cdad-920f7c126d6c') +('b7b68006-53d5-b823-d193-56b262f45e8b', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/ad3ed58a-5645-af0a-eeca-ab543123a8aa', 'Encounter/03e34b19-2889-b828-792d-2a83400c55be', 'DocumentReference/b7b68006-53d5-b823-d193-56b262f45e8b') +('b7b68006-53d5-b823-d193-56b262f45e8b', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/ad3ed58a-5645-af0a-eeca-ab543123a8aa', 'Encounter/03e34b19-2889-b828-792d-2a83400c55be', 'DocumentReference/b7b68006-53d5-b823-d193-56b262f45e8b') +('b953a85f-f18b-d7a3-8974-ba44e0a3141c', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 5), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/a5bc08ea-9462-c4f5-1bd2-ff342598ac99', 'Encounter/f964be66-3fcd-95c8-0021-71c7d24c91b7', 'DocumentReference/b953a85f-f18b-d7a3-8974-ba44e0a3141c') +('b953a85f-f18b-d7a3-8974-ba44e0a3141c', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 5), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/a5bc08ea-9462-c4f5-1bd2-ff342598ac99', 'Encounter/f964be66-3fcd-95c8-0021-71c7d24c91b7', 'DocumentReference/b953a85f-f18b-d7a3-8974-ba44e0a3141c') +('b985a70c-9504-b7b3-0707-f8381ba77976', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/149de67a-2809-59a8-bfa2-36df509021dc', 'Encounter/beb26500-4ccd-ce0a-44f6-74f44be5fafe', 'DocumentReference/b985a70c-9504-b7b3-0707-f8381ba77976') +('b985a70c-9504-b7b3-0707-f8381ba77976', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/149de67a-2809-59a8-bfa2-36df509021dc', 'Encounter/beb26500-4ccd-ce0a-44f6-74f44be5fafe', 'DocumentReference/b985a70c-9504-b7b3-0707-f8381ba77976') +('ba0abbd6-49a9-95fa-2396-7118c56da8c6', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 12), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/9b17654f-a902-3d56-9000-4ade3dd3059f', 'Encounter/ca45bbef-ef2a-3b3c-ea5e-76bcd5865780', 'DocumentReference/ba0abbd6-49a9-95fa-2396-7118c56da8c6') +('ba0abbd6-49a9-95fa-2396-7118c56da8c6', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 12), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/9b17654f-a902-3d56-9000-4ade3dd3059f', 'Encounter/ca45bbef-ef2a-3b3c-ea5e-76bcd5865780', 'DocumentReference/ba0abbd6-49a9-95fa-2396-7118c56da8c6') +('bcbaa9d3-d7cf-3f5f-44d3-32c8a267f991', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/17fde357-dcc9-af8b-a8d3-4bd213afeb22', 'Encounter/32d0ae2d-1be8-9e90-a4da-4c222abd88a9', 'DocumentReference/bcbaa9d3-d7cf-3f5f-44d3-32c8a267f991') +('bcbaa9d3-d7cf-3f5f-44d3-32c8a267f991', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/17fde357-dcc9-af8b-a8d3-4bd213afeb22', 'Encounter/32d0ae2d-1be8-9e90-a4da-4c222abd88a9', 'DocumentReference/bcbaa9d3-d7cf-3f5f-44d3-32c8a267f991') +('bd60a52b-65b9-f26d-03e4-282850509f03', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/51032f44-d514-26e9-3e85-e956561c076e', 'Encounter/d73ed087-e0ae-78e0-7a05-1bac1060c476', 'DocumentReference/bd60a52b-65b9-f26d-03e4-282850509f03') +('bd60a52b-65b9-f26d-03e4-282850509f03', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/51032f44-d514-26e9-3e85-e956561c076e', 'Encounter/d73ed087-e0ae-78e0-7a05-1bac1060c476', 'DocumentReference/bd60a52b-65b9-f26d-03e4-282850509f03') +('bfddb0ff-1296-107e-76ca-14b4a14db9ce', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/26baae20-c8c5-003a-ab6b-ebcc49be20db', 'Encounter/c6ec2350-43d4-abab-2e84-4d2aadb337a7', 'DocumentReference/bfddb0ff-1296-107e-76ca-14b4a14db9ce') +('bfddb0ff-1296-107e-76ca-14b4a14db9ce', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/26baae20-c8c5-003a-ab6b-ebcc49be20db', 'Encounter/c6ec2350-43d4-abab-2e84-4d2aadb337a7', 'DocumentReference/bfddb0ff-1296-107e-76ca-14b4a14db9ce') +('c18dbe84-be31-cee5-1f2e-cf163cdd3e3f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 27), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/a5b171a7-9b28-20e7-86a7-936ecbf55f36', 'Encounter/c4605953-3103-ede6-e0c0-e0588e6f019e', 'DocumentReference/c18dbe84-be31-cee5-1f2e-cf163cdd3e3f') +('c18dbe84-be31-cee5-1f2e-cf163cdd3e3f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 27), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/a5b171a7-9b28-20e7-86a7-936ecbf55f36', 'Encounter/c4605953-3103-ede6-e0c0-e0588e6f019e', 'DocumentReference/c18dbe84-be31-cee5-1f2e-cf163cdd3e3f') +('c6598486-8276-b44a-286e-b376143f7efc', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 25), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/47c37c92-5932-9cfe-66be-208556780fe0', 'Encounter/b5974881-ae62-ddd6-b905-8c86c1ca9e33', 'DocumentReference/c6598486-8276-b44a-286e-b376143f7efc') +('c6598486-8276-b44a-286e-b376143f7efc', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 25), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/47c37c92-5932-9cfe-66be-208556780fe0', 'Encounter/b5974881-ae62-ddd6-b905-8c86c1ca9e33', 'DocumentReference/c6598486-8276-b44a-286e-b376143f7efc') +('c6c64129-9dfa-840d-3309-a5590cc74f2e', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/ad239efc-637c-e428-c829-b87e700d5446', 'Encounter/366df7d3-2ea9-db22-7cdd-60fa8a5c45ca', 'DocumentReference/c6c64129-9dfa-840d-3309-a5590cc74f2e') +('c6c64129-9dfa-840d-3309-a5590cc74f2e', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/ad239efc-637c-e428-c829-b87e700d5446', 'Encounter/366df7d3-2ea9-db22-7cdd-60fa8a5c45ca', 'DocumentReference/c6c64129-9dfa-840d-3309-a5590cc74f2e') +('c84e67e9-4ea8-700b-9f2b-c0179e803d4f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/dffa62dc-8ec2-1cd6-ee75-f9156a5283fe', 'Encounter/11381dc6-0e06-da55-0735-d1e7bbf8bb35', 'DocumentReference/c84e67e9-4ea8-700b-9f2b-c0179e803d4f') +('c84e67e9-4ea8-700b-9f2b-c0179e803d4f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/dffa62dc-8ec2-1cd6-ee75-f9156a5283fe', 'Encounter/11381dc6-0e06-da55-0735-d1e7bbf8bb35', 'DocumentReference/c84e67e9-4ea8-700b-9f2b-c0179e803d4f') diff --git a/tests/test_data/core/core__encounter.txt b/tests/test_data/core/core__encounter.txt index eacd26c7..9a65190e 100644 --- a/tests/test_data/core/core__encounter.txt +++ b/tests/test_data/core/core__encounter.txt @@ -8,43 +8,43 @@ ('2b1ee164-6c87-420d-a9e2-6c235ebeef71', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 15, datetime.date(2018, 6, 8), datetime.date(2018, 6, 8), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/6a883108-7b87-120b-d163-d369336e04e5', 'Encounter/2b1ee164-6c87-420d-a9e2-6c235ebeef71', 'male', 'white', 'not hispanic or latino', '672') ('2f55edb9-a906-0b40-e183-89b1d65d1aa1', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 16, datetime.date(2018, 7, 21), datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/0734762a-9db6-22fc-b595-c3e472bb2a9a', 'Encounter/2f55edb9-a906-0b40-e183-89b1d65d1aa1', 'female', 'white', 'not hispanic or latino', '672') ('32d0ae2d-1be8-9e90-a4da-4c222abd88a9', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 72, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/17fde357-dcc9-af8b-a8d3-4bd213afeb22', 'Encounter/32d0ae2d-1be8-9e90-a4da-4c222abd88a9', 'male', 'white', 'not hispanic or latino', '662') -('366df7d3-2ea9-db22-7cdd-60fa8a5c45ca', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 66, datetime.date(2018, 6, 15), datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/ad239efc-637c-e428-c829-b87e700d5446', 'Encounter/366df7d3-2ea9-db22-7cdd-60fa8a5c45ca', 'male', 'black or african american', 'not hispanic or latino', '678') -('37604257-be1a-120f-81ee-336f81603f92', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 48, datetime.date(2018, 7, 16), datetime.date(2018, 7, 16), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/50f8b42e-17a6-e932-8546-da94004c597c', 'Encounter/37604257-be1a-120f-81ee-336f81603f92', 'male', 'white', 'not hispanic or latino', '666') +('366df7d3-2ea9-db22-7cdd-60fa8a5c45ca', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, '431857002', 'http://snomed.info/sct', None, None, 66, datetime.date(2018, 6, 15), datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/ad239efc-637c-e428-c829-b87e700d5446', 'Encounter/366df7d3-2ea9-db22-7cdd-60fa8a5c45ca', 'male', 'black or african american', 'not hispanic or latino', '678') +('37604257-be1a-120f-81ee-336f81603f92', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, '431857002', 'http://snomed.info/sct', None, None, 48, datetime.date(2018, 7, 16), datetime.date(2018, 7, 16), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/50f8b42e-17a6-e932-8546-da94004c597c', 'Encounter/37604257-be1a-120f-81ee-336f81603f92', 'male', 'white', 'not hispanic or latino', '666') ('4b03a408-6694-88e3-0e63-3ee464ecd6cd', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 73, datetime.date(2018, 7, 11), datetime.date(2018, 7, 11), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/5ce2e599-fb6e-9b4d-3c2e-87310619b957', 'Encounter/4b03a408-6694-88e3-0e63-3ee464ecd6cd', 'male', 'white', 'not hispanic or latino', '660') ('4c4d0730-201f-5b75-c657-8d0de09cc28f', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 60, datetime.date(2018, 6, 14), datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/267fc42d-cd9e-8527-1f9e-887fe7776147', 'Encounter/4c4d0730-201f-5b75-c657-8d0de09cc28f', 'female', 'white', 'not hispanic or latino', '676') ('5c3450fb-12f0-08f3-6e4d-8a5e433e19a4', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 46, datetime.date(2018, 6, 21), datetime.date(2018, 6, 21), datetime.date(2018, 6, 18), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/a46846ca-3f95-2cbb-3a9d-5eae150a0273', 'Encounter/5c3450fb-12f0-08f3-6e4d-8a5e433e19a4', 'female', 'white', 'not hispanic or latino', '660') -('5c994000-aa78-2be5-e6cf-99f230d50c2f', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 81, datetime.date(2018, 7, 13), datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/9eaa056b-1efc-0cc8-70ff-62c8f704cc13', 'Encounter/5c994000-aa78-2be5-e6cf-99f230d50c2f', 'male', 'white', 'not hispanic or latino', '672') +('5c994000-aa78-2be5-e6cf-99f230d50c2f', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, '01', 'http://www.nubc.org/patient-discharge', 81, datetime.date(2018, 7, 13), datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/9eaa056b-1efc-0cc8-70ff-62c8f704cc13', 'Encounter/5c994000-aa78-2be5-e6cf-99f230d50c2f', 'male', 'white', 'not hispanic or latino', '672') ('6565ef5c-30b9-8697-6ca6-2b77894d5437', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 19, datetime.date(2018, 7, 19), datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/d3c0274f-f42b-8d2b-15f2-82331e723383', 'Encounter/6565ef5c-30b9-8697-6ca6-2b77894d5437', 'female', 'white', 'not hispanic or latino', '668') -('65f8fdca-a949-80a0-8072-094e9aaee474', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 9, datetime.date(2018, 6, 17), datetime.date(2018, 6, 17), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/7f941bcc-e7b2-99e1-585f-129d0ef1c13d', 'Encounter/65f8fdca-a949-80a0-8072-094e9aaee474', 'female', 'white', 'not hispanic or latino', '674') +('65f8fdca-a949-80a0-8072-094e9aaee474', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, '10509002', 'http://snomed.info/sct', None, None, 9, datetime.date(2018, 6, 17), datetime.date(2018, 6, 17), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/7f941bcc-e7b2-99e1-585f-129d0ef1c13d', 'Encounter/65f8fdca-a949-80a0-8072-094e9aaee474', 'female', 'white', 'not hispanic or latino', '674') ('683b04eb-663a-849f-715f-4ccd70bf1524', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 12, datetime.date(2018, 7, 26), datetime.date(2018, 7, 26), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/cc9fb8e2-fe52-b72a-aebb-9d10260f121b', 'Encounter/683b04eb-663a-849f-715f-4ccd70bf1524', 'female', 'white', 'not hispanic or latino', '660') -('6a952afd-3be5-e27e-9e05-5a1e085e34d0', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 16, datetime.date(2018, 7, 21), datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/f9399f0d-5401-09f3-d4ff-89b1aa51b9c8', 'Encounter/6a952afd-3be5-e27e-9e05-5a1e085e34d0', 'male', 'white', 'not hispanic or latino', '674') +('6a952afd-3be5-e27e-9e05-5a1e085e34d0', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, '444814009', 'http://snomed.info/sct', None, None, 16, datetime.date(2018, 7, 21), datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/f9399f0d-5401-09f3-d4ff-89b1aa51b9c8', 'Encounter/6a952afd-3be5-e27e-9e05-5a1e085e34d0', 'male', 'white', 'not hispanic or latino', '674') ('75312bd2-d5ac-c62e-c9df-0004783725c7', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 11, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/3ae095ec-8fe0-133b-36d4-8785a6ad8df3', 'Encounter/75312bd2-d5ac-c62e-c9df-0004783725c7', 'female', 'white', 'not hispanic or latino', '662') -('75b68644-535d-bdc1-4c31-aa9fe7e1822f', 'finished', 'EMER', 'emergency', None, None, None, None, None, None, None, None, None, None, 25, datetime.date(2018, 6, 30), datetime.date(2018, 6, 30), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/82b8a670-4700-30e8-24a0-b83efa3c5e0a', 'Encounter/75b68644-535d-bdc1-4c31-aa9fe7e1822f', 'female', 'white', 'not hispanic or latino', '672') -('79d8f213-7847-646b-8a66-5da208cc1c27', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 77, datetime.date(2018, 7, 14), datetime.date(2018, 7, 14), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/26a3984f-b2a8-e67f-7abc-ff147a0e6e35', 'Encounter/79d8f213-7847-646b-8a66-5da208cc1c27', 'male', 'white', 'not hispanic or latino', '674') -('83d0d564-3bbf-48eb-7445-bd2b81130671', 'finished', 'EMER', 'emergency', None, None, None, None, None, None, None, None, None, None, 69, datetime.date(2018, 6, 16), datetime.date(2018, 6, 17), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/16be855b-ece2-8b96-1ef9-a4d93adf3289', 'Encounter/83d0d564-3bbf-48eb-7445-bd2b81130671', 'male', 'white', 'not hispanic or latino', '660') +('75b68644-535d-bdc1-4c31-aa9fe7e1822f', 'finished', 'EMER', 'emergency', None, None, None, None, None, None, '55680006', 'http://snomed.info/sct', None, None, 25, datetime.date(2018, 6, 30), datetime.date(2018, 6, 30), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/82b8a670-4700-30e8-24a0-b83efa3c5e0a', 'Encounter/75b68644-535d-bdc1-4c31-aa9fe7e1822f', 'female', 'white', 'not hispanic or latino', '672') +('79d8f213-7847-646b-8a66-5da208cc1c27', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, '431857002', 'http://snomed.info/sct', None, None, 77, datetime.date(2018, 7, 14), datetime.date(2018, 7, 14), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/26a3984f-b2a8-e67f-7abc-ff147a0e6e35', 'Encounter/79d8f213-7847-646b-8a66-5da208cc1c27', 'male', 'white', 'not hispanic or latino', '674') +('83d0d564-3bbf-48eb-7445-bd2b81130671', 'finished', 'EMER', 'emergency', None, None, None, None, None, None, '55680006', 'http://snomed.info/sct', None, None, 69, datetime.date(2018, 6, 16), datetime.date(2018, 6, 17), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/16be855b-ece2-8b96-1ef9-a4d93adf3289', 'Encounter/83d0d564-3bbf-48eb-7445-bd2b81130671', 'male', 'white', 'not hispanic or latino', '660') ('8ff1dc01-5a28-b2d8-3b42-4b7a7d539970', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 55, datetime.date(2018, 7, 15), datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/c1bfec36-dc2c-afc8-c767-3d35ed2bf6f0', 'Encounter/8ff1dc01-5a28-b2d8-3b42-4b7a7d539970', 'female', 'white', 'not hispanic or latino', '662') ('91f94a9d-69a7-e30a-cd1a-68c52dc01e70', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 22, datetime.date(2018, 6, 29), datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/a28be3e1-a6bd-7df4-fc81-1140848f8453', 'Encounter/91f94a9d-69a7-e30a-cd1a-68c52dc01e70', 'female', 'white', 'not hispanic or latino', '662') ('98d4bd14-d78e-debb-e7dc-2df7786aedf3', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 89, datetime.date(2018, 7, 9), datetime.date(2018, 7, 9), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/e455ca3f-fc16-6ffc-297a-adc27e2db183', 'Encounter/98d4bd14-d78e-debb-e7dc-2df7786aedf3', 'male', 'white', 'hispanic or latino', '667') -('aa890974-162f-5906-dc71-2bb6d2185314', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 50, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/c7c5c028-f1fb-962b-8db2-dfd4c6d6b02a', 'Encounter/aa890974-162f-5906-dc71-2bb6d2185314', 'male', 'white', 'not hispanic or latino', '672') +('aa890974-162f-5906-dc71-2bb6d2185314', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, '431857002', 'http://snomed.info/sct', None, None, 50, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/c7c5c028-f1fb-962b-8db2-dfd4c6d6b02a', 'Encounter/aa890974-162f-5906-dc71-2bb6d2185314', 'male', 'white', 'not hispanic or latino', '672') ('aabb3ac3-c4a3-f613-9507-63280adb9209', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 0, datetime.date(2018, 7, 31), datetime.date(2018, 7, 31), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/2a0e1946-acf6-5a7e-9399-a9cbc4730199', 'Encounter/aabb3ac3-c4a3-f613-9507-63280adb9209', 'female', 'white', 'not hispanic or latino', '675') -('b5974881-ae62-ddd6-b905-8c86c1ca9e33', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 41, datetime.date(2018, 6, 25), datetime.date(2018, 6, 25), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/47c37c92-5932-9cfe-66be-208556780fe0', 'Encounter/b5974881-ae62-ddd6-b905-8c86c1ca9e33', 'male', 'white', 'not hispanic or latino', '675') +('b5974881-ae62-ddd6-b905-8c86c1ca9e33', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, '271737000', 'http://snomed.info/sct', None, None, 41, datetime.date(2018, 6, 25), datetime.date(2018, 6, 25), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/47c37c92-5932-9cfe-66be-208556780fe0', 'Encounter/b5974881-ae62-ddd6-b905-8c86c1ca9e33', 'male', 'white', 'not hispanic or latino', '675') ('b864bcd8-14e0-8bec-b7cc-f8629d91470e', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 15, datetime.date(2018, 6, 28), datetime.date(2018, 6, 28), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/c20e5afd-30df-ac3d-6684-cc29438a9bc4', 'Encounter/b864bcd8-14e0-8bec-b7cc-f8629d91470e', 'female', 'white', 'not hispanic or latino', '662') ('ba84689e-2f9f-7cea-af1f-d69ffdd3a3eb', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 39, datetime.date(2018, 6, 15), datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/7bf52d54-0d2a-265a-15aa-eeed7aaf4af6', 'Encounter/ba84689e-2f9f-7cea-af1f-d69ffdd3a3eb', 'female', 'white', 'not hispanic or latino', '670') -('bca7cabc-b2fc-8a08-c69b-5bc0afa20d80', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 28, datetime.date(2018, 7, 13), datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/3627adb8-f741-acf3-2dd6-10f3bcbe1077', 'Encounter/bca7cabc-b2fc-8a08-c69b-5bc0afa20d80', 'female', 'white', 'not hispanic or latino', '674') +('bca7cabc-b2fc-8a08-c69b-5bc0afa20d80', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, '271737000', 'http://snomed.info/sct', None, None, 28, datetime.date(2018, 7, 13), datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/3627adb8-f741-acf3-2dd6-10f3bcbe1077', 'Encounter/bca7cabc-b2fc-8a08-c69b-5bc0afa20d80', 'female', 'white', 'not hispanic or latino', '674') ('beb26500-4ccd-ce0a-44f6-74f44be5fafe', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 14, datetime.date(2018, 6, 7), datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/149de67a-2809-59a8-bfa2-36df509021dc', 'Encounter/beb26500-4ccd-ce0a-44f6-74f44be5fafe', 'female', 'white', 'not hispanic or latino', '667') ('c4605953-3103-ede6-e0c0-e0588e6f019e', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 61, datetime.date(2018, 7, 27), datetime.date(2018, 7, 27), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/a5b171a7-9b28-20e7-86a7-936ecbf55f36', 'Encounter/c4605953-3103-ede6-e0c0-e0588e6f019e', 'female', 'white', 'not hispanic or latino', '675') ('c6ec2350-43d4-abab-2e84-4d2aadb337a7', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 53, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/26baae20-c8c5-003a-ab6b-ebcc49be20db', 'Encounter/c6ec2350-43d4-abab-2e84-4d2aadb337a7', 'male', 'white', 'not hispanic or latino', '678') -('ca45bbef-ef2a-3b3c-ea5e-76bcd5865780', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 48, datetime.date(2018, 6, 12), datetime.date(2018, 6, 12), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/9b17654f-a902-3d56-9000-4ade3dd3059f', 'Encounter/ca45bbef-ef2a-3b3c-ea5e-76bcd5865780', 'female', 'white', 'hispanic or latino', '672') +('ca45bbef-ef2a-3b3c-ea5e-76bcd5865780', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, '72892002', 'http://snomed.info/sct', None, None, 48, datetime.date(2018, 6, 12), datetime.date(2018, 6, 12), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/9b17654f-a902-3d56-9000-4ade3dd3059f', 'Encounter/ca45bbef-ef2a-3b3c-ea5e-76bcd5865780', 'female', 'white', 'hispanic or latino', '672') ('d2782687-6885-037c-957d-579fbd681d2a', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 54, datetime.date(2018, 6, 13), datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/3cf7af45-2bee-aa9c-d524-40b487149d60', 'Encounter/d2782687-6885-037c-957d-579fbd681d2a', 'male', 'white', 'not hispanic or latino', '000') -('d5f342b7-017c-f2e7-8697-5a038c91518e', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 20, datetime.date(2018, 7, 28), datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/2da1bee2-2bc2-4511-84e1-42860310e2fb', 'Encounter/d5f342b7-017c-f2e7-8697-5a038c91518e', 'female', 'white', 'not hispanic or latino', '660') -('d735c414-9dd3-c9b1-285c-8da79a7fbbdf', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 61, datetime.date(2018, 7, 29), datetime.date(2018, 7, 29), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/7cef0e6f-9aea-4079-dfc6-18a96454708e', 'Encounter/d735c414-9dd3-c9b1-285c-8da79a7fbbdf', 'female', 'white', 'not hispanic or latino', '662') +('d5f342b7-017c-f2e7-8697-5a038c91518e', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, '72892002', 'http://snomed.info/sct', None, None, 20, datetime.date(2018, 7, 28), datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/2da1bee2-2bc2-4511-84e1-42860310e2fb', 'Encounter/d5f342b7-017c-f2e7-8697-5a038c91518e', 'female', 'white', 'not hispanic or latino', '660') +('d735c414-9dd3-c9b1-285c-8da79a7fbbdf', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, '431857002', 'http://snomed.info/sct', None, None, 61, datetime.date(2018, 7, 29), datetime.date(2018, 7, 29), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/7cef0e6f-9aea-4079-dfc6-18a96454708e', 'Encounter/d735c414-9dd3-c9b1-285c-8da79a7fbbdf', 'female', 'white', 'not hispanic or latino', '662') ('d73ed087-e0ae-78e0-7a05-1bac1060c476', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 45, datetime.date(2018, 7, 10), datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/51032f44-d514-26e9-3e85-e956561c076e', 'Encounter/d73ed087-e0ae-78e0-7a05-1bac1060c476', 'female', 'white', 'not hispanic or latino', '667') ('dc5ed645-3979-e765-3e03-6ba2173027c3', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 90, datetime.date(2018, 7, 7), datetime.date(2018, 7, 7), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/ac91b90d-97e4-4fc5-41cd-036bac49e6e8', 'Encounter/dc5ed645-3979-e765-3e03-6ba2173027c3', 'male', 'white', 'not hispanic or latino', '671') ('de9d67de-6ae3-32f7-20f2-e719ae23a9a3', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 3, datetime.date(2018, 7, 30), datetime.date(2018, 7, 30), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/2858705f-5af1-9869-4d94-894e09a9f99a', 'Encounter/de9d67de-6ae3-32f7-20f2-e719ae23a9a3', 'male', 'white', 'not hispanic or latino', '672') ('e5dabcb6-1d7a-7467-dbba-b864d0d5f5b0', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 49, datetime.date(2018, 7, 28), datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/0b052286-9534-99a8-8d5e-06c2c04a7df7', 'Encounter/e5dabcb6-1d7a-7467-dbba-b864d0d5f5b0', 'female', 'white', 'not hispanic or latino', '662') -('e613f29d-7505-6f2e-a1f5-bfbec300752d', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 84, datetime.date(2018, 6, 29), datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/1c498b42-61fd-6341-69c3-053f6e4fe404', 'Encounter/e613f29d-7505-6f2e-a1f5-bfbec300752d', 'female', 'white', 'not hispanic or latino', '667') +('e613f29d-7505-6f2e-a1f5-bfbec300752d', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, '88805009', 'http://snomed.info/sct', None, None, 84, datetime.date(2018, 6, 29), datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/1c498b42-61fd-6341-69c3-053f6e4fe404', 'Encounter/e613f29d-7505-6f2e-a1f5-bfbec300752d', 'female', 'white', 'not hispanic or latino', '667') ('e922a884-7039-a171-a65e-78051fe7afe6', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 1, datetime.date(2018, 6, 13), datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/8022fbbe-aaa4-056c-d0f5-ec074bf0656c', 'Encounter/e922a884-7039-a171-a65e-78051fe7afe6', 'male', 'white', 'not hispanic or latino', '665') -('ed151e04-3dd6-8cb7-a3e5-777c8a8667f1', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 57, datetime.date(2018, 6, 6), datetime.date(2018, 6, 6), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/19158de4-66a2-f70f-e3bf-4396b312c8f1', 'Encounter/ed151e04-3dd6-8cb7-a3e5-777c8a8667f1', 'female', 'white', 'not hispanic or latino', '000') -('f2752dd7-1bf1-739d-dd8c-40122d0b63bc', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 77, datetime.date(2018, 6, 1), datetime.date(2018, 6, 2), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/9c8d8539-0b1e-73e2-b64f-83f1ea601fa4', 'Encounter/f2752dd7-1bf1-739d-dd8c-40122d0b63bc', 'male', 'white', 'not hispanic or latino', '674') -('f964be66-3fcd-95c8-0021-71c7d24c91b7', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 63, datetime.date(2018, 6, 5), datetime.date(2018, 6, 5), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/a5bc08ea-9462-c4f5-1bd2-ff342598ac99', 'Encounter/f964be66-3fcd-95c8-0021-71c7d24c91b7', 'female', 'white', 'not hispanic or latino', '661') +('ed151e04-3dd6-8cb7-a3e5-777c8a8667f1', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, '195662009', 'http://snomed.info/sct', None, None, 57, datetime.date(2018, 6, 6), datetime.date(2018, 6, 6), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/19158de4-66a2-f70f-e3bf-4396b312c8f1', 'Encounter/ed151e04-3dd6-8cb7-a3e5-777c8a8667f1', 'female', 'white', 'not hispanic or latino', '000') +('f2752dd7-1bf1-739d-dd8c-40122d0b63bc', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, '161665007', 'http://snomed.info/sct', None, None, 77, datetime.date(2018, 6, 1), datetime.date(2018, 6, 2), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/9c8d8539-0b1e-73e2-b64f-83f1ea601fa4', 'Encounter/f2752dd7-1bf1-739d-dd8c-40122d0b63bc', 'male', 'white', 'not hispanic or latino', '674') +('f964be66-3fcd-95c8-0021-71c7d24c91b7', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, '431857002', 'http://snomed.info/sct', None, None, 63, datetime.date(2018, 6, 5), datetime.date(2018, 6, 5), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/a5bc08ea-9462-c4f5-1bd2-ff342598ac99', 'Encounter/f964be66-3fcd-95c8-0021-71c7d24c91b7', 'female', 'white', 'not hispanic or latino', '661') ('fd0754a4-e96d-cba7-b3c0-77697a09c86e', 'finished', 'AMB', 'ambulatory', None, None, None, None, None, None, None, None, None, None, 100, datetime.date(2018, 7, 10), datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/6385ddd7-2639-6505-3789-0521b8f66c8b', 'Encounter/fd0754a4-e96d-cba7-b3c0-77697a09c86e', 'female', 'white', 'not hispanic or latino', '672') diff --git a/tests/test_data/core/core__encounter_type.txt b/tests/test_data/core/core__encounter_type.txt index 5b5db79e..732a4af7 100644 --- a/tests/test_data/core/core__encounter_type.txt +++ b/tests/test_data/core/core__encounter_type.txt @@ -1,50 +1,50 @@ -('029d1814-d7bf-0624-524d-7ccda5f320f6', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 15, datetime.date(2018, 6, 3), datetime.date(2018, 6, 3), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/e80dda2c-a260-dbf7-3167-bf0945f3a91d', 'Encounter/029d1814-d7bf-0624-524d-7ccda5f320f6', 'female', 'black or african american', 'not hispanic or latino', '672') -('02eb4e14-1a6f-d968-2c26-c0cf5023afe0', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 57, datetime.date(2018, 6, 7), datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/c7ad408d-fcae-b54a-eb1d-26d48f7a5f84', 'Encounter/02eb4e14-1a6f-d968-2c26-c0cf5023afe0', 'female', 'white', 'not hispanic or latino', '660') -('03e34b19-2889-b828-792d-2a83400c55be', 'EMER', 'emergency', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 20, datetime.date(2018, 7, 19), datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/ad3ed58a-5645-af0a-eeca-ab543123a8aa', 'Encounter/03e34b19-2889-b828-792d-2a83400c55be', 'female', 'white', 'not hispanic or latino', '662') -('11381dc6-0e06-da55-0735-d1e7bbf8bb35', 'EMER', 'emergency', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 8, datetime.date(2018, 7, 15), datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/dffa62dc-8ec2-1cd6-ee75-f9156a5283fe', 'Encounter/11381dc6-0e06-da55-0735-d1e7bbf8bb35', 'male', 'white', 'hispanic or latino', '672') -('1154d05c-8727-9373-4224-25b9fdba9ab3', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 25, datetime.date(2018, 6, 14), datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/24906e2c-e556-71dc-23d9-3e1d5fb08986', 'Encounter/1154d05c-8727-9373-4224-25b9fdba9ab3', 'female', 'white', 'hispanic or latino', '671') -('1d679c3a-2765-5e13-e2a3-4bd76a898fc6', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 50, datetime.date(2018, 6, 15), datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/cb8c0665-30ee-479c-8994-d29f1a6848b0', 'Encounter/1d679c3a-2765-5e13-e2a3-4bd76a898fc6', 'male', 'white', 'not hispanic or latino', '662') -('299b6495-3fe7-8db3-c494-6e1ce8b7986d', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 30, datetime.date(2018, 6, 2), datetime.date(2018, 6, 2), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/8877ef1f-7cd7-3242-d7f0-73cf3f7165f4', 'Encounter/299b6495-3fe7-8db3-c494-6e1ce8b7986d', 'male', 'black or african american', 'hispanic or latino', '660') -('2b1ee164-6c87-420d-a9e2-6c235ebeef71', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 15, datetime.date(2018, 6, 8), datetime.date(2018, 6, 8), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/6a883108-7b87-120b-d163-d369336e04e5', 'Encounter/2b1ee164-6c87-420d-a9e2-6c235ebeef71', 'male', 'white', 'not hispanic or latino', '672') -('2f55edb9-a906-0b40-e183-89b1d65d1aa1', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 16, datetime.date(2018, 7, 21), datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/0734762a-9db6-22fc-b595-c3e472bb2a9a', 'Encounter/2f55edb9-a906-0b40-e183-89b1d65d1aa1', 'female', 'white', 'not hispanic or latino', '672') -('32d0ae2d-1be8-9e90-a4da-4c222abd88a9', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 72, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/17fde357-dcc9-af8b-a8d3-4bd213afeb22', 'Encounter/32d0ae2d-1be8-9e90-a4da-4c222abd88a9', 'male', 'white', 'not hispanic or latino', '662') -('366df7d3-2ea9-db22-7cdd-60fa8a5c45ca', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 66, datetime.date(2018, 6, 15), datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/ad239efc-637c-e428-c829-b87e700d5446', 'Encounter/366df7d3-2ea9-db22-7cdd-60fa8a5c45ca', 'male', 'black or african american', 'not hispanic or latino', '678') -('37604257-be1a-120f-81ee-336f81603f92', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 48, datetime.date(2018, 7, 16), datetime.date(2018, 7, 16), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/50f8b42e-17a6-e932-8546-da94004c597c', 'Encounter/37604257-be1a-120f-81ee-336f81603f92', 'male', 'white', 'not hispanic or latino', '666') -('4b03a408-6694-88e3-0e63-3ee464ecd6cd', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 73, datetime.date(2018, 7, 11), datetime.date(2018, 7, 11), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/5ce2e599-fb6e-9b4d-3c2e-87310619b957', 'Encounter/4b03a408-6694-88e3-0e63-3ee464ecd6cd', 'male', 'white', 'not hispanic or latino', '660') -('4c4d0730-201f-5b75-c657-8d0de09cc28f', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 60, datetime.date(2018, 6, 14), datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/267fc42d-cd9e-8527-1f9e-887fe7776147', 'Encounter/4c4d0730-201f-5b75-c657-8d0de09cc28f', 'female', 'white', 'not hispanic or latino', '676') -('5c3450fb-12f0-08f3-6e4d-8a5e433e19a4', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 46, datetime.date(2018, 6, 21), datetime.date(2018, 6, 21), datetime.date(2018, 6, 18), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/a46846ca-3f95-2cbb-3a9d-5eae150a0273', 'Encounter/5c3450fb-12f0-08f3-6e4d-8a5e433e19a4', 'female', 'white', 'not hispanic or latino', '660') -('5c994000-aa78-2be5-e6cf-99f230d50c2f', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 81, datetime.date(2018, 7, 13), datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/9eaa056b-1efc-0cc8-70ff-62c8f704cc13', 'Encounter/5c994000-aa78-2be5-e6cf-99f230d50c2f', 'male', 'white', 'not hispanic or latino', '672') -('6565ef5c-30b9-8697-6ca6-2b77894d5437', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 19, datetime.date(2018, 7, 19), datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/d3c0274f-f42b-8d2b-15f2-82331e723383', 'Encounter/6565ef5c-30b9-8697-6ca6-2b77894d5437', 'female', 'white', 'not hispanic or latino', '668') -('65f8fdca-a949-80a0-8072-094e9aaee474', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 9, datetime.date(2018, 6, 17), datetime.date(2018, 6, 17), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/7f941bcc-e7b2-99e1-585f-129d0ef1c13d', 'Encounter/65f8fdca-a949-80a0-8072-094e9aaee474', 'female', 'white', 'not hispanic or latino', '674') -('683b04eb-663a-849f-715f-4ccd70bf1524', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 12, datetime.date(2018, 7, 26), datetime.date(2018, 7, 26), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/cc9fb8e2-fe52-b72a-aebb-9d10260f121b', 'Encounter/683b04eb-663a-849f-715f-4ccd70bf1524', 'female', 'white', 'not hispanic or latino', '660') -('6a952afd-3be5-e27e-9e05-5a1e085e34d0', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 16, datetime.date(2018, 7, 21), datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/f9399f0d-5401-09f3-d4ff-89b1aa51b9c8', 'Encounter/6a952afd-3be5-e27e-9e05-5a1e085e34d0', 'male', 'white', 'not hispanic or latino', '674') -('75312bd2-d5ac-c62e-c9df-0004783725c7', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 11, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/3ae095ec-8fe0-133b-36d4-8785a6ad8df3', 'Encounter/75312bd2-d5ac-c62e-c9df-0004783725c7', 'female', 'white', 'not hispanic or latino', '662') -('75b68644-535d-bdc1-4c31-aa9fe7e1822f', 'EMER', 'emergency', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 25, datetime.date(2018, 6, 30), datetime.date(2018, 6, 30), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/82b8a670-4700-30e8-24a0-b83efa3c5e0a', 'Encounter/75b68644-535d-bdc1-4c31-aa9fe7e1822f', 'female', 'white', 'not hispanic or latino', '672') -('79d8f213-7847-646b-8a66-5da208cc1c27', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 77, datetime.date(2018, 7, 14), datetime.date(2018, 7, 14), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/26a3984f-b2a8-e67f-7abc-ff147a0e6e35', 'Encounter/79d8f213-7847-646b-8a66-5da208cc1c27', 'male', 'white', 'not hispanic or latino', '674') -('83d0d564-3bbf-48eb-7445-bd2b81130671', 'EMER', 'emergency', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 69, datetime.date(2018, 6, 16), datetime.date(2018, 6, 17), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/16be855b-ece2-8b96-1ef9-a4d93adf3289', 'Encounter/83d0d564-3bbf-48eb-7445-bd2b81130671', 'male', 'white', 'not hispanic or latino', '660') -('8ff1dc01-5a28-b2d8-3b42-4b7a7d539970', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 55, datetime.date(2018, 7, 15), datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/c1bfec36-dc2c-afc8-c767-3d35ed2bf6f0', 'Encounter/8ff1dc01-5a28-b2d8-3b42-4b7a7d539970', 'female', 'white', 'not hispanic or latino', '662') -('91f94a9d-69a7-e30a-cd1a-68c52dc01e70', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 22, datetime.date(2018, 6, 29), datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/a28be3e1-a6bd-7df4-fc81-1140848f8453', 'Encounter/91f94a9d-69a7-e30a-cd1a-68c52dc01e70', 'female', 'white', 'not hispanic or latino', '662') -('98d4bd14-d78e-debb-e7dc-2df7786aedf3', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 89, datetime.date(2018, 7, 9), datetime.date(2018, 7, 9), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/e455ca3f-fc16-6ffc-297a-adc27e2db183', 'Encounter/98d4bd14-d78e-debb-e7dc-2df7786aedf3', 'male', 'white', 'hispanic or latino', '667') -('aa890974-162f-5906-dc71-2bb6d2185314', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 50, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/c7c5c028-f1fb-962b-8db2-dfd4c6d6b02a', 'Encounter/aa890974-162f-5906-dc71-2bb6d2185314', 'male', 'white', 'not hispanic or latino', '672') -('aabb3ac3-c4a3-f613-9507-63280adb9209', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 0, datetime.date(2018, 7, 31), datetime.date(2018, 7, 31), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/2a0e1946-acf6-5a7e-9399-a9cbc4730199', 'Encounter/aabb3ac3-c4a3-f613-9507-63280adb9209', 'female', 'white', 'not hispanic or latino', '675') -('b5974881-ae62-ddd6-b905-8c86c1ca9e33', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 41, datetime.date(2018, 6, 25), datetime.date(2018, 6, 25), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/47c37c92-5932-9cfe-66be-208556780fe0', 'Encounter/b5974881-ae62-ddd6-b905-8c86c1ca9e33', 'male', 'white', 'not hispanic or latino', '675') -('b864bcd8-14e0-8bec-b7cc-f8629d91470e', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 15, datetime.date(2018, 6, 28), datetime.date(2018, 6, 28), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/c20e5afd-30df-ac3d-6684-cc29438a9bc4', 'Encounter/b864bcd8-14e0-8bec-b7cc-f8629d91470e', 'female', 'white', 'not hispanic or latino', '662') -('ba84689e-2f9f-7cea-af1f-d69ffdd3a3eb', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 39, datetime.date(2018, 6, 15), datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/7bf52d54-0d2a-265a-15aa-eeed7aaf4af6', 'Encounter/ba84689e-2f9f-7cea-af1f-d69ffdd3a3eb', 'female', 'white', 'not hispanic or latino', '670') -('bca7cabc-b2fc-8a08-c69b-5bc0afa20d80', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 28, datetime.date(2018, 7, 13), datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/3627adb8-f741-acf3-2dd6-10f3bcbe1077', 'Encounter/bca7cabc-b2fc-8a08-c69b-5bc0afa20d80', 'female', 'white', 'not hispanic or latino', '674') -('beb26500-4ccd-ce0a-44f6-74f44be5fafe', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 14, datetime.date(2018, 6, 7), datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/149de67a-2809-59a8-bfa2-36df509021dc', 'Encounter/beb26500-4ccd-ce0a-44f6-74f44be5fafe', 'female', 'white', 'not hispanic or latino', '667') -('c4605953-3103-ede6-e0c0-e0588e6f019e', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 61, datetime.date(2018, 7, 27), datetime.date(2018, 7, 27), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/a5b171a7-9b28-20e7-86a7-936ecbf55f36', 'Encounter/c4605953-3103-ede6-e0c0-e0588e6f019e', 'female', 'white', 'not hispanic or latino', '675') -('c6ec2350-43d4-abab-2e84-4d2aadb337a7', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 53, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/26baae20-c8c5-003a-ab6b-ebcc49be20db', 'Encounter/c6ec2350-43d4-abab-2e84-4d2aadb337a7', 'male', 'white', 'not hispanic or latino', '678') -('ca45bbef-ef2a-3b3c-ea5e-76bcd5865780', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 48, datetime.date(2018, 6, 12), datetime.date(2018, 6, 12), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/9b17654f-a902-3d56-9000-4ade3dd3059f', 'Encounter/ca45bbef-ef2a-3b3c-ea5e-76bcd5865780', 'female', 'white', 'hispanic or latino', '672') -('d2782687-6885-037c-957d-579fbd681d2a', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 54, datetime.date(2018, 6, 13), datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/3cf7af45-2bee-aa9c-d524-40b487149d60', 'Encounter/d2782687-6885-037c-957d-579fbd681d2a', 'male', 'white', 'not hispanic or latino', '000') -('d5f342b7-017c-f2e7-8697-5a038c91518e', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 20, datetime.date(2018, 7, 28), datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/2da1bee2-2bc2-4511-84e1-42860310e2fb', 'Encounter/d5f342b7-017c-f2e7-8697-5a038c91518e', 'female', 'white', 'not hispanic or latino', '660') -('d735c414-9dd3-c9b1-285c-8da79a7fbbdf', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 61, datetime.date(2018, 7, 29), datetime.date(2018, 7, 29), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/7cef0e6f-9aea-4079-dfc6-18a96454708e', 'Encounter/d735c414-9dd3-c9b1-285c-8da79a7fbbdf', 'female', 'white', 'not hispanic or latino', '662') -('d73ed087-e0ae-78e0-7a05-1bac1060c476', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 45, datetime.date(2018, 7, 10), datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/51032f44-d514-26e9-3e85-e956561c076e', 'Encounter/d73ed087-e0ae-78e0-7a05-1bac1060c476', 'female', 'white', 'not hispanic or latino', '667') -('dc5ed645-3979-e765-3e03-6ba2173027c3', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 90, datetime.date(2018, 7, 7), datetime.date(2018, 7, 7), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/ac91b90d-97e4-4fc5-41cd-036bac49e6e8', 'Encounter/dc5ed645-3979-e765-3e03-6ba2173027c3', 'male', 'white', 'not hispanic or latino', '671') -('de9d67de-6ae3-32f7-20f2-e719ae23a9a3', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 3, datetime.date(2018, 7, 30), datetime.date(2018, 7, 30), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/2858705f-5af1-9869-4d94-894e09a9f99a', 'Encounter/de9d67de-6ae3-32f7-20f2-e719ae23a9a3', 'male', 'white', 'not hispanic or latino', '672') -('e5dabcb6-1d7a-7467-dbba-b864d0d5f5b0', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 49, datetime.date(2018, 7, 28), datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/0b052286-9534-99a8-8d5e-06c2c04a7df7', 'Encounter/e5dabcb6-1d7a-7467-dbba-b864d0d5f5b0', 'female', 'white', 'not hispanic or latino', '662') -('e613f29d-7505-6f2e-a1f5-bfbec300752d', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 84, datetime.date(2018, 6, 29), datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/1c498b42-61fd-6341-69c3-053f6e4fe404', 'Encounter/e613f29d-7505-6f2e-a1f5-bfbec300752d', 'female', 'white', 'not hispanic or latino', '667') -('e922a884-7039-a171-a65e-78051fe7afe6', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 1, datetime.date(2018, 6, 13), datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/8022fbbe-aaa4-056c-d0f5-ec074bf0656c', 'Encounter/e922a884-7039-a171-a65e-78051fe7afe6', 'male', 'white', 'not hispanic or latino', '665') -('ed151e04-3dd6-8cb7-a3e5-777c8a8667f1', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 57, datetime.date(2018, 6, 6), datetime.date(2018, 6, 6), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/19158de4-66a2-f70f-e3bf-4396b312c8f1', 'Encounter/ed151e04-3dd6-8cb7-a3e5-777c8a8667f1', 'female', 'white', 'not hispanic or latino', '000') -('f2752dd7-1bf1-739d-dd8c-40122d0b63bc', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 77, datetime.date(2018, 6, 1), datetime.date(2018, 6, 2), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/9c8d8539-0b1e-73e2-b64f-83f1ea601fa4', 'Encounter/f2752dd7-1bf1-739d-dd8c-40122d0b63bc', 'male', 'white', 'not hispanic or latino', '674') -('f964be66-3fcd-95c8-0021-71c7d24c91b7', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 63, datetime.date(2018, 6, 5), datetime.date(2018, 6, 5), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/a5bc08ea-9462-c4f5-1bd2-ff342598ac99', 'Encounter/f964be66-3fcd-95c8-0021-71c7d24c91b7', 'female', 'white', 'not hispanic or latino', '661') -('fd0754a4-e96d-cba7-b3c0-77697a09c86e', 'AMB', 'ambulatory', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 100, datetime.date(2018, 7, 10), datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/6385ddd7-2639-6505-3789-0521b8f66c8b', 'Encounter/fd0754a4-e96d-cba7-b3c0-77697a09c86e', 'female', 'white', 'not hispanic or latino', '672') +('029d1814-d7bf-0624-524d-7ccda5f320f6', 'AMB', 'ambulatory', 'http://snomed.info/sct', '371883000', 'Outpatient procedure', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 15, datetime.date(2018, 6, 3), datetime.date(2018, 6, 3), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/e80dda2c-a260-dbf7-3167-bf0945f3a91d', 'Encounter/029d1814-d7bf-0624-524d-7ccda5f320f6', 'female', 'black or african american', 'not hispanic or latino', '672') +('02eb4e14-1a6f-d968-2c26-c0cf5023afe0', 'AMB', 'ambulatory', 'http://snomed.info/sct', '162673000', 'General examination of patient (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 57, datetime.date(2018, 6, 7), datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/c7ad408d-fcae-b54a-eb1d-26d48f7a5f84', 'Encounter/02eb4e14-1a6f-d968-2c26-c0cf5023afe0', 'female', 'white', 'not hispanic or latino', '660') +('03e34b19-2889-b828-792d-2a83400c55be', 'EMER', 'emergency', 'http://snomed.info/sct', '50849002', 'Emergency room admission (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 20, datetime.date(2018, 7, 19), datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/ad3ed58a-5645-af0a-eeca-ab543123a8aa', 'Encounter/03e34b19-2889-b828-792d-2a83400c55be', 'female', 'white', 'not hispanic or latino', '662') +('11381dc6-0e06-da55-0735-d1e7bbf8bb35', 'EMER', 'emergency', 'http://snomed.info/sct', '50849002', 'Emergency room admission (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 8, datetime.date(2018, 7, 15), datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/dffa62dc-8ec2-1cd6-ee75-f9156a5283fe', 'Encounter/11381dc6-0e06-da55-0735-d1e7bbf8bb35', 'male', 'white', 'hispanic or latino', '672') +('1154d05c-8727-9373-4224-25b9fdba9ab3', 'AMB', 'ambulatory', 'http://snomed.info/sct', '162673000', 'General examination of patient (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 25, datetime.date(2018, 6, 14), datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/24906e2c-e556-71dc-23d9-3e1d5fb08986', 'Encounter/1154d05c-8727-9373-4224-25b9fdba9ab3', 'female', 'white', 'hispanic or latino', '671') +('1d679c3a-2765-5e13-e2a3-4bd76a898fc6', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185349003', 'Encounter for check up', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 50, datetime.date(2018, 6, 15), datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/cb8c0665-30ee-479c-8994-d29f1a6848b0', 'Encounter/1d679c3a-2765-5e13-e2a3-4bd76a898fc6', 'male', 'white', 'not hispanic or latino', '662') +('299b6495-3fe7-8db3-c494-6e1ce8b7986d', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185349003', 'Encounter for check up (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 30, datetime.date(2018, 6, 2), datetime.date(2018, 6, 2), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/8877ef1f-7cd7-3242-d7f0-73cf3f7165f4', 'Encounter/299b6495-3fe7-8db3-c494-6e1ce8b7986d', 'male', 'black or african american', 'hispanic or latino', '660') +('2b1ee164-6c87-420d-a9e2-6c235ebeef71', 'AMB', 'ambulatory', 'http://snomed.info/sct', '702927004', 'Urgent care clinic (environment)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 15, datetime.date(2018, 6, 8), datetime.date(2018, 6, 8), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/6a883108-7b87-120b-d163-d369336e04e5', 'Encounter/2b1ee164-6c87-420d-a9e2-6c235ebeef71', 'male', 'white', 'not hispanic or latino', '672') +('2f55edb9-a906-0b40-e183-89b1d65d1aa1', 'AMB', 'ambulatory', 'http://snomed.info/sct', '371883000', 'Outpatient procedure', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 16, datetime.date(2018, 7, 21), datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/0734762a-9db6-22fc-b595-c3e472bb2a9a', 'Encounter/2f55edb9-a906-0b40-e183-89b1d65d1aa1', 'female', 'white', 'not hispanic or latino', '672') +('32d0ae2d-1be8-9e90-a4da-4c222abd88a9', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185349003', 'Encounter for check up (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 72, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/17fde357-dcc9-af8b-a8d3-4bd213afeb22', 'Encounter/32d0ae2d-1be8-9e90-a4da-4c222abd88a9', 'male', 'white', 'not hispanic or latino', '662') +('366df7d3-2ea9-db22-7cdd-60fa8a5c45ca', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185347001', 'Encounter for problem (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', '431857002', 'Chronic kidney disease stage 4 (disorder)', 'finished', 66, datetime.date(2018, 6, 15), datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/ad239efc-637c-e428-c829-b87e700d5446', 'Encounter/366df7d3-2ea9-db22-7cdd-60fa8a5c45ca', 'male', 'black or african american', 'not hispanic or latino', '678') +('37604257-be1a-120f-81ee-336f81603f92', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185347001', 'Encounter for problem (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', '431857002', 'Chronic kidney disease stage 4 (disorder)', 'finished', 48, datetime.date(2018, 7, 16), datetime.date(2018, 7, 16), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/50f8b42e-17a6-e932-8546-da94004c597c', 'Encounter/37604257-be1a-120f-81ee-336f81603f92', 'male', 'white', 'not hispanic or latino', '666') +('4b03a408-6694-88e3-0e63-3ee464ecd6cd', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185349003', 'Encounter for check up (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 73, datetime.date(2018, 7, 11), datetime.date(2018, 7, 11), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/5ce2e599-fb6e-9b4d-3c2e-87310619b957', 'Encounter/4b03a408-6694-88e3-0e63-3ee464ecd6cd', 'male', 'white', 'not hispanic or latino', '660') +('4c4d0730-201f-5b75-c657-8d0de09cc28f', 'AMB', 'ambulatory', 'http://snomed.info/sct', '702927004', 'Urgent care clinic (environment)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 60, datetime.date(2018, 6, 14), datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/267fc42d-cd9e-8527-1f9e-887fe7776147', 'Encounter/4c4d0730-201f-5b75-c657-8d0de09cc28f', 'female', 'white', 'not hispanic or latino', '676') +('5c3450fb-12f0-08f3-6e4d-8a5e433e19a4', 'AMB', 'ambulatory', 'http://snomed.info/sct', '308335008', 'Patient encounter procedure', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 46, datetime.date(2018, 6, 21), datetime.date(2018, 6, 21), datetime.date(2018, 6, 18), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/a46846ca-3f95-2cbb-3a9d-5eae150a0273', 'Encounter/5c3450fb-12f0-08f3-6e4d-8a5e433e19a4', 'female', 'white', 'not hispanic or latino', '660') +('5c994000-aa78-2be5-e6cf-99f230d50c2f', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185349003', 'Encounter for check up (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 81, datetime.date(2018, 7, 13), datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/9eaa056b-1efc-0cc8-70ff-62c8f704cc13', 'Encounter/5c994000-aa78-2be5-e6cf-99f230d50c2f', 'male', 'white', 'not hispanic or latino', '672') +('6565ef5c-30b9-8697-6ca6-2b77894d5437', 'AMB', 'ambulatory', 'http://snomed.info/sct', '308335008', 'Patient encounter procedure', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 19, datetime.date(2018, 7, 19), datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/d3c0274f-f42b-8d2b-15f2-82331e723383', 'Encounter/6565ef5c-30b9-8697-6ca6-2b77894d5437', 'female', 'white', 'not hispanic or latino', '668') +('65f8fdca-a949-80a0-8072-094e9aaee474', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185345009', 'Encounter for symptom', 'None', 'None', 'None', 'None', 'None', 'None', '10509002', 'Acute bronchitis (disorder)', 'finished', 9, datetime.date(2018, 6, 17), datetime.date(2018, 6, 17), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/7f941bcc-e7b2-99e1-585f-129d0ef1c13d', 'Encounter/65f8fdca-a949-80a0-8072-094e9aaee474', 'female', 'white', 'not hispanic or latino', '674') +('683b04eb-663a-849f-715f-4ccd70bf1524', 'AMB', 'ambulatory', 'http://snomed.info/sct', '410620009', 'Well child visit (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 12, datetime.date(2018, 7, 26), datetime.date(2018, 7, 26), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/cc9fb8e2-fe52-b72a-aebb-9d10260f121b', 'Encounter/683b04eb-663a-849f-715f-4ccd70bf1524', 'female', 'white', 'not hispanic or latino', '660') +('6a952afd-3be5-e27e-9e05-5a1e085e34d0', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185345009', 'Encounter for symptom', 'None', 'None', 'None', 'None', 'None', 'None', '444814009', 'Viral sinusitis (disorder)', 'finished', 16, datetime.date(2018, 7, 21), datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/f9399f0d-5401-09f3-d4ff-89b1aa51b9c8', 'Encounter/6a952afd-3be5-e27e-9e05-5a1e085e34d0', 'male', 'white', 'not hispanic or latino', '674') +('75312bd2-d5ac-c62e-c9df-0004783725c7', 'AMB', 'ambulatory', 'http://snomed.info/sct', '410620009', 'Well child visit (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 11, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/3ae095ec-8fe0-133b-36d4-8785a6ad8df3', 'Encounter/75312bd2-d5ac-c62e-c9df-0004783725c7', 'female', 'white', 'not hispanic or latino', '662') +('75b68644-535d-bdc1-4c31-aa9fe7e1822f', 'EMER', 'emergency', 'http://snomed.info/sct', '50849002', 'Emergency room admission (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', '55680006', 'Drug overdose', 'finished', 25, datetime.date(2018, 6, 30), datetime.date(2018, 6, 30), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/82b8a670-4700-30e8-24a0-b83efa3c5e0a', 'Encounter/75b68644-535d-bdc1-4c31-aa9fe7e1822f', 'female', 'white', 'not hispanic or latino', '672') +('79d8f213-7847-646b-8a66-5da208cc1c27', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185347001', 'Encounter for problem (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', '431857002', 'Chronic kidney disease stage 4 (disorder)', 'finished', 77, datetime.date(2018, 7, 14), datetime.date(2018, 7, 14), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/26a3984f-b2a8-e67f-7abc-ff147a0e6e35', 'Encounter/79d8f213-7847-646b-8a66-5da208cc1c27', 'male', 'white', 'not hispanic or latino', '674') +('83d0d564-3bbf-48eb-7445-bd2b81130671', 'EMER', 'emergency', 'http://snomed.info/sct', '50849002', 'Emergency room admission (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', '55680006', 'Drug overdose', 'finished', 69, datetime.date(2018, 6, 16), datetime.date(2018, 6, 17), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/16be855b-ece2-8b96-1ef9-a4d93adf3289', 'Encounter/83d0d564-3bbf-48eb-7445-bd2b81130671', 'male', 'white', 'not hispanic or latino', '660') +('8ff1dc01-5a28-b2d8-3b42-4b7a7d539970', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185349003', 'Encounter for check up (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 55, datetime.date(2018, 7, 15), datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/c1bfec36-dc2c-afc8-c767-3d35ed2bf6f0', 'Encounter/8ff1dc01-5a28-b2d8-3b42-4b7a7d539970', 'female', 'white', 'not hispanic or latino', '662') +('91f94a9d-69a7-e30a-cd1a-68c52dc01e70', 'AMB', 'ambulatory', 'http://snomed.info/sct', '308335008', 'Patient encounter procedure', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 22, datetime.date(2018, 6, 29), datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/a28be3e1-a6bd-7df4-fc81-1140848f8453', 'Encounter/91f94a9d-69a7-e30a-cd1a-68c52dc01e70', 'female', 'white', 'not hispanic or latino', '662') +('98d4bd14-d78e-debb-e7dc-2df7786aedf3', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185349003', 'Encounter for check up (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 89, datetime.date(2018, 7, 9), datetime.date(2018, 7, 9), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/e455ca3f-fc16-6ffc-297a-adc27e2db183', 'Encounter/98d4bd14-d78e-debb-e7dc-2df7786aedf3', 'male', 'white', 'hispanic or latino', '667') +('aa890974-162f-5906-dc71-2bb6d2185314', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185347001', 'Encounter for problem (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', '431857002', 'Chronic kidney disease stage 4 (disorder)', 'finished', 50, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/c7c5c028-f1fb-962b-8db2-dfd4c6d6b02a', 'Encounter/aa890974-162f-5906-dc71-2bb6d2185314', 'male', 'white', 'not hispanic or latino', '672') +('aabb3ac3-c4a3-f613-9507-63280adb9209', 'AMB', 'ambulatory', 'http://snomed.info/sct', '410620009', 'Well child visit (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 0, datetime.date(2018, 7, 31), datetime.date(2018, 7, 31), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/2a0e1946-acf6-5a7e-9399-a9cbc4730199', 'Encounter/aabb3ac3-c4a3-f613-9507-63280adb9209', 'female', 'white', 'not hispanic or latino', '675') +('b5974881-ae62-ddd6-b905-8c86c1ca9e33', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185347001', 'Encounter for problem', 'None', 'None', 'None', 'None', 'None', 'None', '271737000', 'Anemia (disorder)', 'finished', 41, datetime.date(2018, 6, 25), datetime.date(2018, 6, 25), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/47c37c92-5932-9cfe-66be-208556780fe0', 'Encounter/b5974881-ae62-ddd6-b905-8c86c1ca9e33', 'male', 'white', 'not hispanic or latino', '675') +('b864bcd8-14e0-8bec-b7cc-f8629d91470e', 'AMB', 'ambulatory', 'http://snomed.info/sct', '698314001', 'Consultation for treatment', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 15, datetime.date(2018, 6, 28), datetime.date(2018, 6, 28), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/c20e5afd-30df-ac3d-6684-cc29438a9bc4', 'Encounter/b864bcd8-14e0-8bec-b7cc-f8629d91470e', 'female', 'white', 'not hispanic or latino', '662') +('ba84689e-2f9f-7cea-af1f-d69ffdd3a3eb', 'AMB', 'ambulatory', 'http://snomed.info/sct', '698314001', 'Consultation for treatment', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 39, datetime.date(2018, 6, 15), datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/7bf52d54-0d2a-265a-15aa-eeed7aaf4af6', 'Encounter/ba84689e-2f9f-7cea-af1f-d69ffdd3a3eb', 'female', 'white', 'not hispanic or latino', '670') +('bca7cabc-b2fc-8a08-c69b-5bc0afa20d80', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185347001', 'Encounter for problem', 'None', 'None', 'None', 'None', 'None', 'None', '271737000', 'Anemia (disorder)', 'finished', 28, datetime.date(2018, 7, 13), datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/3627adb8-f741-acf3-2dd6-10f3bcbe1077', 'Encounter/bca7cabc-b2fc-8a08-c69b-5bc0afa20d80', 'female', 'white', 'not hispanic or latino', '674') +('beb26500-4ccd-ce0a-44f6-74f44be5fafe', 'AMB', 'ambulatory', 'http://snomed.info/sct', '698314001', 'Consultation for treatment', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 14, datetime.date(2018, 6, 7), datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/149de67a-2809-59a8-bfa2-36df509021dc', 'Encounter/beb26500-4ccd-ce0a-44f6-74f44be5fafe', 'female', 'white', 'not hispanic or latino', '667') +('c4605953-3103-ede6-e0c0-e0588e6f019e', 'AMB', 'ambulatory', 'http://snomed.info/sct', '162673000', 'General examination of patient (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 61, datetime.date(2018, 7, 27), datetime.date(2018, 7, 27), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/a5b171a7-9b28-20e7-86a7-936ecbf55f36', 'Encounter/c4605953-3103-ede6-e0c0-e0588e6f019e', 'female', 'white', 'not hispanic or latino', '675') +('c6ec2350-43d4-abab-2e84-4d2aadb337a7', 'AMB', 'ambulatory', 'http://snomed.info/sct', '162673000', 'General examination of patient (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 53, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/26baae20-c8c5-003a-ab6b-ebcc49be20db', 'Encounter/c6ec2350-43d4-abab-2e84-4d2aadb337a7', 'male', 'white', 'not hispanic or latino', '678') +('ca45bbef-ef2a-3b3c-ea5e-76bcd5865780', 'AMB', 'ambulatory', 'http://snomed.info/sct', '424619006', 'Prenatal visit', 'None', 'None', 'None', 'None', 'None', 'None', '72892002', 'Normal pregnancy', 'finished', 48, datetime.date(2018, 6, 12), datetime.date(2018, 6, 12), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/9b17654f-a902-3d56-9000-4ade3dd3059f', 'Encounter/ca45bbef-ef2a-3b3c-ea5e-76bcd5865780', 'female', 'white', 'hispanic or latino', '672') +('d2782687-6885-037c-957d-579fbd681d2a', 'AMB', 'ambulatory', 'http://snomed.info/sct', '162673000', 'General examination of patient (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 54, datetime.date(2018, 6, 13), datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/3cf7af45-2bee-aa9c-d524-40b487149d60', 'Encounter/d2782687-6885-037c-957d-579fbd681d2a', 'male', 'white', 'not hispanic or latino', '000') +('d5f342b7-017c-f2e7-8697-5a038c91518e', 'AMB', 'ambulatory', 'http://snomed.info/sct', '424619006', 'Prenatal visit', 'None', 'None', 'None', 'None', 'None', 'None', '72892002', 'Normal pregnancy', 'finished', 20, datetime.date(2018, 7, 28), datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/2da1bee2-2bc2-4511-84e1-42860310e2fb', 'Encounter/d5f342b7-017c-f2e7-8697-5a038c91518e', 'female', 'white', 'not hispanic or latino', '660') +('d735c414-9dd3-c9b1-285c-8da79a7fbbdf', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185347001', 'Encounter for problem (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', '431857002', 'Chronic kidney disease stage 4 (disorder)', 'finished', 61, datetime.date(2018, 7, 29), datetime.date(2018, 7, 29), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/7cef0e6f-9aea-4079-dfc6-18a96454708e', 'Encounter/d735c414-9dd3-c9b1-285c-8da79a7fbbdf', 'female', 'white', 'not hispanic or latino', '662') +('d73ed087-e0ae-78e0-7a05-1bac1060c476', 'AMB', 'ambulatory', 'http://snomed.info/sct', '698314001', 'Consultation for treatment', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 45, datetime.date(2018, 7, 10), datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/51032f44-d514-26e9-3e85-e956561c076e', 'Encounter/d73ed087-e0ae-78e0-7a05-1bac1060c476', 'female', 'white', 'not hispanic or latino', '667') +('dc5ed645-3979-e765-3e03-6ba2173027c3', 'AMB', 'ambulatory', 'http://snomed.info/sct', '702927004', 'Urgent care clinic (environment)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 90, datetime.date(2018, 7, 7), datetime.date(2018, 7, 7), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/ac91b90d-97e4-4fc5-41cd-036bac49e6e8', 'Encounter/dc5ed645-3979-e765-3e03-6ba2173027c3', 'male', 'white', 'not hispanic or latino', '671') +('de9d67de-6ae3-32f7-20f2-e719ae23a9a3', 'AMB', 'ambulatory', 'http://snomed.info/sct', '410620009', 'Well child visit (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 3, datetime.date(2018, 7, 30), datetime.date(2018, 7, 30), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/2858705f-5af1-9869-4d94-894e09a9f99a', 'Encounter/de9d67de-6ae3-32f7-20f2-e719ae23a9a3', 'male', 'white', 'not hispanic or latino', '672') +('e5dabcb6-1d7a-7467-dbba-b864d0d5f5b0', 'AMB', 'ambulatory', 'http://snomed.info/sct', '162673000', 'General examination of patient (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 49, datetime.date(2018, 7, 28), datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/0b052286-9534-99a8-8d5e-06c2c04a7df7', 'Encounter/e5dabcb6-1d7a-7467-dbba-b864d0d5f5b0', 'female', 'white', 'not hispanic or latino', '662') +('e613f29d-7505-6f2e-a1f5-bfbec300752d', 'AMB', 'ambulatory', 'http://snomed.info/sct', '448337001', 'Telemedicine consultation with patient', 'None', 'None', 'None', 'None', 'None', 'None', '88805009', 'Chronic congestive heart failure (disorder)', 'finished', 84, datetime.date(2018, 6, 29), datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/1c498b42-61fd-6341-69c3-053f6e4fe404', 'Encounter/e613f29d-7505-6f2e-a1f5-bfbec300752d', 'female', 'white', 'not hispanic or latino', '667') +('e922a884-7039-a171-a65e-78051fe7afe6', 'AMB', 'ambulatory', 'http://snomed.info/sct', '410620009', 'Well child visit (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 1, datetime.date(2018, 6, 13), datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/8022fbbe-aaa4-056c-d0f5-ec074bf0656c', 'Encounter/e922a884-7039-a171-a65e-78051fe7afe6', 'male', 'white', 'not hispanic or latino', '665') +('ed151e04-3dd6-8cb7-a3e5-777c8a8667f1', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185345009', 'Encounter for symptom', 'None', 'None', 'None', 'None', 'None', 'None', '195662009', 'Acute viral pharyngitis (disorder)', 'finished', 57, datetime.date(2018, 6, 6), datetime.date(2018, 6, 6), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/19158de4-66a2-f70f-e3bf-4396b312c8f1', 'Encounter/ed151e04-3dd6-8cb7-a3e5-777c8a8667f1', 'female', 'white', 'not hispanic or latino', '000') +('f2752dd7-1bf1-739d-dd8c-40122d0b63bc', 'AMB', 'ambulatory', 'http://snomed.info/sct', '439740005', 'Postoperative follow-up visit (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', '161665007', 'History of renal transplant (situation)', 'finished', 77, datetime.date(2018, 6, 1), datetime.date(2018, 6, 2), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/9c8d8539-0b1e-73e2-b64f-83f1ea601fa4', 'Encounter/f2752dd7-1bf1-739d-dd8c-40122d0b63bc', 'male', 'white', 'not hispanic or latino', '674') +('f964be66-3fcd-95c8-0021-71c7d24c91b7', 'AMB', 'ambulatory', 'http://snomed.info/sct', '185347001', 'Encounter for problem (procedure)', 'None', 'None', 'None', 'None', 'None', 'None', '431857002', 'Chronic kidney disease stage 4 (disorder)', 'finished', 63, datetime.date(2018, 6, 5), datetime.date(2018, 6, 5), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'Patient/a5bc08ea-9462-c4f5-1bd2-ff342598ac99', 'Encounter/f964be66-3fcd-95c8-0021-71c7d24c91b7', 'female', 'white', 'not hispanic or latino', '661') +('fd0754a4-e96d-cba7-b3c0-77697a09c86e', 'AMB', 'ambulatory', 'http://snomed.info/sct', '702927004', 'Urgent care clinic (environment)', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'None', 'finished', 100, datetime.date(2018, 7, 10), datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'Patient/6385ddd7-2639-6505-3789-0521b8f66c8b', 'Encounter/fd0754a4-e96d-cba7-b3c0-77697a09c86e', 'female', 'white', 'not hispanic or latino', '672') diff --git a/tests/test_data/duckdb_data/encounter/encounters.arbitrary.name.ndjson b/tests/test_data/duckdb_data/encounter/encounters.arbitrary.name.ndjson index 9102bc62..dbe364ca 100644 --- a/tests/test_data/duckdb_data/encounter/encounters.arbitrary.name.ndjson +++ b/tests/test_data/duckdb_data/encounter/encounters.arbitrary.name.ndjson @@ -1,4 +1,4 @@ -{"resourceType": "Encounter", "id": "5c994000-aa78-2be5-e6cf-99f230d50c2f", "meta": {"profile": ["http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter"]}, "identifier": [{"use": "official", "system": "https://github.com/synthetichealth/synthea", "value": "5c994000-aa78-2be5-e6cf-99f230d50c2f"}], "status": "finished", "class": {"system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", "code": "AMB"}, "type": [{"coding": [{"system": "http://snomed.info/sct", "code": "185349003", "display": "Encounter for check up (procedure)"}], "text": "Encounter for check up (procedure)"}], "subject": {"reference": "Patient/9eaa056b-1efc-0cc8-70ff-62c8f704cc13", "display": "Mr. Waldo53 Amado512 Glover433"}, "participant": [{"type": [{"coding": [{"system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", "code": "PPRF", "display": "primary performer"}], "text": "primary performer"}], "period": {"start": "2018-07-13T13:30:43-04:00", "end": "2018-07-13T13:45:43-04:00"}, "individual": {"reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999970798", "display": "Dr. Tamra871 Kerluke267"}}], "period": {"start": "2018-07-13T13:30:43-04:00", "end": "2018-07-13T13:45:43-04:00"}, "location": [{"location": {"reference": "Location?identifier=https://github.com/synthetichealth/synthea|81846412-0624-32f7-86d8-ee6eccb07942", "display": "Wichita Vet Center"}}], "serviceProvider": {"reference": "Organization?identifier=https://github.com/synthetichealth/synthea|979603fb-1332-36b1-988f-21c2347aa1ad", "display": "Wichita Vet Center"}} +{"resourceType": "Encounter", "id": "5c994000-aa78-2be5-e6cf-99f230d50c2f", "meta": {"profile": ["http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter"]}, "identifier": [{"use": "official", "system": "https://github.com/synthetichealth/synthea", "value": "5c994000-aa78-2be5-e6cf-99f230d50c2f"}], "status": "finished", "class": {"system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", "code": "AMB"}, "type": [{"coding": [{"system": "http://snomed.info/sct", "code": "185349003", "display": "Encounter for check up (procedure)"}], "text": "Encounter for check up (procedure)"}], "subject": {"reference": "Patient/9eaa056b-1efc-0cc8-70ff-62c8f704cc13", "display": "Mr. Waldo53 Amado512 Glover433"}, "participant": [{"type": [{"coding": [{"system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", "code": "PPRF", "display": "primary performer"}], "text": "primary performer"}], "period": {"start": "2018-07-13T13:30:43-04:00", "end": "2018-07-13T13:45:43-04:00"}, "individual": {"reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999970798", "display": "Dr. Tamra871 Kerluke267"}}], "period": {"start": "2018-07-13T13:30:43-04:00", "end": "2018-07-13T13:45:43-04:00"}, "location": [{"location": {"reference": "Location?identifier=https://github.com/synthetichealth/synthea|81846412-0624-32f7-86d8-ee6eccb07942", "display": "Wichita Vet Center"}}], "serviceProvider": {"reference": "Organization?identifier=https://github.com/synthetichealth/synthea|979603fb-1332-36b1-988f-21c2347aa1ad", "display": "Wichita Vet Center"},"hospitalization": {"dischargeDisposition": {"coding": [{"code": "01","display": "Discharged to home care or self care (routine discharge)", "system": "http://www.nubc.org/patient-discharge"}], "text": "Discharged to home care or self care (routine discharge)"},"id": "null"}} {"resourceType": "Encounter", "id": "683b04eb-663a-849f-715f-4ccd70bf1524", "meta": {"profile": ["http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter"]}, "identifier": [{"use": "official", "system": "https://github.com/synthetichealth/synthea", "value": "683b04eb-663a-849f-715f-4ccd70bf1524"}], "status": "finished", "class": {"system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", "code": "AMB"}, "type": [{"coding": [{"system": "http://snomed.info/sct", "code": "410620009", "display": "Well child visit (procedure)"}], "text": "Well child visit (procedure)"}], "subject": {"reference": "Patient/cc9fb8e2-fe52-b72a-aebb-9d10260f121b", "display": "Babette571 Mignon230 Bashirian201"}, "participant": [{"type": [{"coding": [{"system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", "code": "PPRF", "display": "primary performer"}], "text": "primary performer"}], "period": {"start": "2018-07-26T19:42:29-04:00", "end": "2018-07-26T19:57:29-04:00"}, "individual": {"reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999932699", "display": "Dr. Julia241 Quintana711"}}], "period": {"start": "2018-07-26T19:42:29-04:00", "end": "2018-07-26T19:57:29-04:00"}, "location": [{"location": {"reference": "Location?identifier=https://github.com/synthetichealth/synthea|36b7a3c9-9190-3b4c-bb4e-b83f64b6cbdb", "display": "MAKING CONNECTIONS, LLC INDIVIDUAL AND FAMILY SERVICES"}}], "serviceProvider": {"reference": "Organization?identifier=https://github.com/synthetichealth/synthea|b59d77b5-7b57-3f7e-9a76-5e0e1ef4f62d", "display": "MAKING CONNECTIONS, LLC INDIVIDUAL AND FAMILY SERVICES"}} {"resourceType": "Encounter", "id": "e613f29d-7505-6f2e-a1f5-bfbec300752d", "meta": {"profile": ["http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter"]}, "identifier": [{"use": "official", "system": "https://github.com/synthetichealth/synthea", "value": "e613f29d-7505-6f2e-a1f5-bfbec300752d"}], "status": "finished", "class": {"system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", "code": "AMB"}, "type": [{"coding": [{"system": "http://snomed.info/sct", "code": "448337001", "display": "Telemedicine consultation with patient"}], "text": "Telemedicine consultation with patient"}], "subject": {"reference": "Patient/1c498b42-61fd-6341-69c3-053f6e4fe404", "display": "Mrs. Kala987 Katlyn29 Daniel959"}, "participant": [{"type": [{"coding": [{"system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", "code": "PPRF", "display": "primary performer"}], "text": "primary performer"}], "period": {"start": "2018-06-29T00:31:23-04:00", "end": "2018-06-29T00:46:23-04:00"}, "individual": {"reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999896399", "display": "Dr. Tiffani287 Toy286"}}], "period": {"start": "2018-06-29T00:31:23-04:00", "end": "2018-06-29T00:46:23-04:00"}, "reasonCode": [{"coding": [{"system": "http://snomed.info/sct", "code": "88805009", "display": "Chronic congestive heart failure (disorder)"}]}], "location": [{"location": {"reference": "Location?identifier=https://github.com/synthetichealth/synthea|0b9875ba-9310-313d-93d4-bf552585d527", "display": "LIFE CARE CENTER OF BURLINGTON"}}], "serviceProvider": {"reference": "Organization?identifier=https://github.com/synthetichealth/synthea|658bfe6a-1b87-3ca3-9923-959fd4e14477", "display": "LIFE CARE CENTER OF BURLINGTON"}} {"resourceType": "Encounter", "id": "1154d05c-8727-9373-4224-25b9fdba9ab3", "meta": {"profile": ["http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter"]}, "identifier": [{"use": "official", "system": "https://github.com/synthetichealth/synthea", "value": "1154d05c-8727-9373-4224-25b9fdba9ab3"}], "status": "finished", "class": {"system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", "code": "AMB"}, "type": [{"coding": [{"system": "http://snomed.info/sct", "code": "162673000", "display": "General examination of patient (procedure)"}], "text": "General examination of patient (procedure)"}], "subject": {"reference": "Patient/24906e2c-e556-71dc-23d9-3e1d5fb08986", "display": "Mrs. Sofia418 Natalia964 Armas910"}, "participant": [{"type": [{"coding": [{"system": "http://terminology.hl7.org/CodeSystem/v3-ParticipationType", "code": "PPRF", "display": "primary performer"}], "text": "primary performer"}], "period": {"start": "2018-06-14T19:21:26-04:00", "end": "2018-06-14T19:57:04-04:00"}, "individual": {"reference": "Practitioner?identifier=http://hl7.org/fhir/sid/us-npi|9999949198", "display": "Dr. Florance664 Leannon79"}}], "period": {"start": "2018-06-14T19:21:26-04:00", "end": "2018-06-14T19:57:04-04:00"}, "location": [{"location": {"reference": "Location?identifier=https://github.com/synthetichealth/synthea|b4f5949b-6d3a-342d-b7fb-53f277207a64", "display": "HOSPITAL DISTRICT NO 6 OF HARPER COUNTY KANSAS"}}], "serviceProvider": {"reference": "Organization?identifier=https://github.com/synthetichealth/synthea|e3963cc4-4b2d-3626-97d2-96cf2aaf50fe", "display": "HOSPITAL DISTRICT NO 6 OF HARPER COUNTY KANSAS"}} diff --git a/tests/test_data/duckdb_data/expected_export/core/core__count_encounter_enc_type_month.csv b/tests/test_data/duckdb_data/expected_export/core/core__count_encounter_enc_type_month.csv index 6f79e0cd..2f66e7fd 100644 --- a/tests/test_data/duckdb_data/expected_export/core/core__count_encounter_enc_type_month.csv +++ b/tests/test_data/duckdb_data/expected_export/core/core__count_encounter_enc_type_month.csv @@ -1,13 +1,7 @@ cnt,enc_class_display,enc_type_display,start_month 50,,, -50,,None, 46,ambulatory,, -46,ambulatory,None, 26,,,2018-07-01 -26,,None,2018-07-01 24,,,2018-06-01 -24,,None,2018-06-01 24,ambulatory,,2018-07-01 -24,ambulatory,None,2018-07-01 22,ambulatory,,2018-06-01 -22,ambulatory,None,2018-06-01 diff --git a/tests/test_data/duckdb_data/expected_export/core/core__count_encounter_type.csv b/tests/test_data/duckdb_data/expected_export/core/core__count_encounter_type.csv index 4207fcc7..61e6f092 100644 --- a/tests/test_data/duckdb_data/expected_export/core/core__count_encounter_type.csv +++ b/tests/test_data/duckdb_data/expected_export/core/core__count_encounter_type.csv @@ -3,15 +3,7 @@ cnt,enc_class_display,enc_type_display,enc_service_display,enc_priority_display 50,,,,None 50,,,None, 50,,,None,None -50,,None,, -50,,None,,None -50,,None,None, -50,,None,None,None 46,ambulatory,,, 46,ambulatory,,,None 46,ambulatory,,None, 46,ambulatory,,None,None -46,ambulatory,None,, -46,ambulatory,None,,None -46,ambulatory,None,None, -46,ambulatory,None,None,None diff --git a/tests/test_data/duckdb_data/expected_export/core/core__count_encounter_type_month.csv b/tests/test_data/duckdb_data/expected_export/core/core__count_encounter_type_month.csv index 99f73572..610aa74b 100644 --- a/tests/test_data/duckdb_data/expected_export/core/core__count_encounter_type_month.csv +++ b/tests/test_data/duckdb_data/expected_export/core/core__count_encounter_type_month.csv @@ -3,47 +3,23 @@ cnt,enc_class_display,enc_type_display,enc_service_display,enc_priority_display, 50,,,,None, 50,,,None,, 50,,,None,None, -50,,None,,, -50,,None,,None, -50,,None,None,, -50,,None,None,None, 46,ambulatory,,,, 46,ambulatory,,,None, 46,ambulatory,,None,, 46,ambulatory,,None,None, -46,ambulatory,None,,, -46,ambulatory,None,,None, -46,ambulatory,None,None,, -46,ambulatory,None,None,None, 26,,,,,2018-07-01 26,,,,None,2018-07-01 26,,,None,,2018-07-01 26,,,None,None,2018-07-01 -26,,None,,,2018-07-01 -26,,None,,None,2018-07-01 -26,,None,None,,2018-07-01 -26,,None,None,None,2018-07-01 24,,,,,2018-06-01 24,,,,None,2018-06-01 24,,,None,,2018-06-01 24,,,None,None,2018-06-01 -24,,None,,,2018-06-01 -24,,None,,None,2018-06-01 -24,,None,None,,2018-06-01 -24,,None,None,None,2018-06-01 24,ambulatory,,,,2018-07-01 24,ambulatory,,,None,2018-07-01 24,ambulatory,,None,,2018-07-01 24,ambulatory,,None,None,2018-07-01 -24,ambulatory,None,,,2018-07-01 -24,ambulatory,None,,None,2018-07-01 -24,ambulatory,None,None,,2018-07-01 -24,ambulatory,None,None,None,2018-07-01 22,ambulatory,,,,2018-06-01 22,ambulatory,,,None,2018-06-01 22,ambulatory,,None,,2018-06-01 22,ambulatory,,None,None,2018-06-01 -22,ambulatory,None,,,2018-06-01 -22,ambulatory,None,,None,2018-06-01 -22,ambulatory,None,None,,2018-06-01 -22,ambulatory,None,None,None,2018-06-01 diff --git a/tests/test_duckdb.py b/tests/test_duckdb.py index 3c68c32b..ac67142e 100644 --- a/tests/test_duckdb.py +++ b/tests/test_duckdb.py @@ -19,6 +19,7 @@ clear=True, ) def test_duckdb_core_build_and_export(tmp_path): + print(tmp_path) data_dir = f"{Path(__file__).parent}/test_data/duckdb_data" cli.main( [ diff --git a/tests/test_templates.py b/tests/test_templates.py index 55a32418..50ca5975 100644 --- a/tests/test_templates.py +++ b/tests/test_templates.py @@ -55,11 +55,12 @@ def test_codeable_concept_denormalize_all_creation(): config = sql_utils.CodeableConceptConfig( source_table="source", source_id="id", - column_name="code_col", + column_hierarchy=[("code_col", list)], target_table="target__concepts", - is_array=True, ) query = base_templates.get_codeable_concept_denormalize_query(config) + with open("output.sql", "w") as f: + f.write(query) assert query == expected @@ -144,9 +145,8 @@ def test_codeable_concept_denormalize_filter_creation(): config = sql_utils.CodeableConceptConfig( source_table="source", source_id="id", - column_name="code_col", + column_hierarchy=[("code_col", dict)], target_table="target__concepts", - is_array=False, filter_priority=True, code_systems=[ "http://snomed.info/sct", From f965d007d3fbd3ed7b38d4629e901b84210c0f91 Mon Sep 17 00:00:00 2001 From: Matt Garber Date: Thu, 21 Mar 2024 10:24:29 -0400 Subject: [PATCH 3/8] ref sql regen --- .../core/reference_sql/builder_condition.sql | 24 ++++------ .../builder_documentreference.sql | 6 +-- .../core/reference_sql/builder_encounter.sql | 48 +++++++------------ .../builder_medicationrequest.sql | 38 +++++++++++---- .../reference_sql/builder_observation.sql | 9 ++-- 5 files changed, 59 insertions(+), 66 deletions(-) diff --git a/cumulus_library/studies/core/reference_sql/builder_condition.sql b/cumulus_library/studies/core/reference_sql/builder_condition.sql index fd86cb05..c4f6946c 100644 --- a/cumulus_library/studies/core/reference_sql/builder_condition.sql +++ b/cumulus_library/studies/core/reference_sql/builder_condition.sql @@ -17,8 +17,7 @@ CREATE TABLE core__condition_codable_concepts_display AS ( u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - - condition AS s, + condition AS s, UNNEST(s.code.coding) AS u (codeable_concept) WHERE u.codeable_concept.system LIKE 'http://snomed.info/sct' @@ -32,8 +31,7 @@ CREATE TABLE core__condition_codable_concepts_display AS ( u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - - condition AS s, + condition AS s, UNNEST(s.code.coding) AS u (codeable_concept) WHERE u.codeable_concept.system LIKE 'http://hl7.org/fhir/sid/icd-10-cm' @@ -47,8 +45,7 @@ CREATE TABLE core__condition_codable_concepts_display AS ( u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - - condition AS s, + condition AS s, UNNEST(s.code.coding) AS u (codeable_concept) WHERE u.codeable_concept.system LIKE 'http://hl7.org/fhir/sid/icd-9-cm' @@ -62,8 +59,7 @@ CREATE TABLE core__condition_codable_concepts_display AS ( u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - - condition AS s, + condition AS s, UNNEST(s.code.coding) AS u (codeable_concept) WHERE u.codeable_concept.system LIKE 'http://hl7.org/fhir/sid/icd-9-cm/diagnosis' @@ -77,8 +73,7 @@ CREATE TABLE core__condition_codable_concepts_display AS ( u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - - condition AS s, + condition AS s, UNNEST(s.code.coding) AS u (codeable_concept) WHERE u.codeable_concept.system LIKE 'urn:oid:1.2.840.114350.1.13.71.2.7.2.728286' @@ -92,8 +87,7 @@ CREATE TABLE core__condition_codable_concepts_display AS ( u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - - condition AS s, + condition AS s, UNNEST(s.code.coding) AS u (codeable_concept) WHERE u.codeable_concept.system LIKE 'urn:oid:1.2.840.114350.1.13.71.2.7.4.698084.10375' @@ -107,8 +101,7 @@ CREATE TABLE core__condition_codable_concepts_display AS ( u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - - condition AS s, + condition AS s, UNNEST(s.code.coding) AS u (codeable_concept) WHERE u.codeable_concept.system LIKE 'http://terminology.hl7.org/CodeSystem/data-absent-reason' @@ -212,8 +205,7 @@ CREATE TABLE core__condition_codable_concepts_all AS ( u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - - condition AS s, + condition AS s, UNNEST(s.code.coding) AS u (codeable_concept) ), --noqa: LT07 diff --git a/cumulus_library/studies/core/reference_sql/builder_documentreference.sql b/cumulus_library/studies/core/reference_sql/builder_documentreference.sql index 2257ab6c..accbfa3b 100644 --- a/cumulus_library/studies/core/reference_sql/builder_documentreference.sql +++ b/cumulus_library/studies/core/reference_sql/builder_documentreference.sql @@ -16,8 +16,7 @@ CREATE TABLE core__documentreference_dn_type AS ( u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - - documentreference AS s, + documentreference AS s, UNNEST(s.type.coding) AS u (codeable_concept) ), --noqa: LT07 @@ -52,8 +51,7 @@ CREATE TABLE core__documentreference_dn_category AS ( u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - - documentreference AS s, + documentreference AS s, UNNEST(s.category) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) WHERE diff --git a/cumulus_library/studies/core/reference_sql/builder_encounter.sql b/cumulus_library/studies/core/reference_sql/builder_encounter.sql index 8d54a723..e813bdaf 100644 --- a/cumulus_library/studies/core/reference_sql/builder_encounter.sql +++ b/cumulus_library/studies/core/reference_sql/builder_encounter.sql @@ -17,8 +17,7 @@ CREATE TABLE core__encounter_dn_type AS ( u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - - encounter AS s, + encounter AS s, UNNEST(s.type) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) WHERE @@ -33,8 +32,7 @@ CREATE TABLE core__encounter_dn_type AS ( u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - - encounter AS s, + encounter AS s, UNNEST(s.type) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) WHERE @@ -49,8 +47,7 @@ CREATE TABLE core__encounter_dn_type AS ( u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - - encounter AS s, + encounter AS s, UNNEST(s.type) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) WHERE @@ -65,8 +62,7 @@ CREATE TABLE core__encounter_dn_type AS ( u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - - encounter AS s, + encounter AS s, UNNEST(s.type) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) WHERE @@ -81,8 +77,7 @@ CREATE TABLE core__encounter_dn_type AS ( u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - - encounter AS s, + encounter AS s, UNNEST(s.type) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) WHERE @@ -97,8 +92,7 @@ CREATE TABLE core__encounter_dn_type AS ( u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - - encounter AS s, + encounter AS s, UNNEST(s.type) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) WHERE @@ -113,8 +107,7 @@ CREATE TABLE core__encounter_dn_type AS ( u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - - encounter AS s, + encounter AS s, UNNEST(s.type) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) WHERE @@ -129,8 +122,7 @@ CREATE TABLE core__encounter_dn_type AS ( u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - - encounter AS s, + encounter AS s, UNNEST(s.type) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) WHERE @@ -145,8 +137,7 @@ CREATE TABLE core__encounter_dn_type AS ( u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - - encounter AS s, + encounter AS s, UNNEST(s.type) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) WHERE @@ -290,8 +281,7 @@ CREATE TABLE core__encounter_dn_reasoncode AS ( u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - - encounter AS s, + encounter AS s, UNNEST(s.reasoncode) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) WHERE @@ -306,8 +296,7 @@ CREATE TABLE core__encounter_dn_reasoncode AS ( u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - - encounter AS s, + encounter AS s, UNNEST(s.reasoncode) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) WHERE @@ -322,8 +311,7 @@ CREATE TABLE core__encounter_dn_reasoncode AS ( u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - - encounter AS s, + encounter AS s, UNNEST(s.reasoncode) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) WHERE @@ -338,8 +326,7 @@ CREATE TABLE core__encounter_dn_reasoncode AS ( u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - - encounter AS s, + encounter AS s, UNNEST(s.reasoncode) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) WHERE @@ -354,8 +341,7 @@ CREATE TABLE core__encounter_dn_reasoncode AS ( u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - - encounter AS s, + encounter AS s, UNNEST(s.reasoncode) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) WHERE @@ -370,8 +356,7 @@ CREATE TABLE core__encounter_dn_reasoncode AS ( u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - - encounter AS s, + encounter AS s, UNNEST(s.reasoncode) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) WHERE @@ -468,8 +453,7 @@ CREATE TABLE core__encounter_dn_dischargedisposition AS ( u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - - encounter AS s, + encounter AS s, UNNEST(s.hospitalization.dischargedisposition.coding) AS u (codeable_concept) ), --noqa: LT07 diff --git a/cumulus_library/studies/core/reference_sql/builder_medicationrequest.sql b/cumulus_library/studies/core/reference_sql/builder_medicationrequest.sql index 22246657..738379c7 100644 --- a/cumulus_library/studies/core/reference_sql/builder_medicationrequest.sql +++ b/cumulus_library/studies/core/reference_sql/builder_medicationrequest.sql @@ -16,8 +16,7 @@ CREATE TABLE core__medicationrequest_dn_category AS ( u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - - medicationrequest AS s, + medicationrequest AS s, UNNEST(s.category) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) ), --noqa: LT07 @@ -42,15 +41,38 @@ CREATE TABLE core__medicationrequest_dn_category AS ( -- ########################################################### -CREATE TABLE IF NOT EXISTS "main"."core__medicationrequest_dn_medication" -AS ( - SELECT * FROM ( - VALUES - (cast(NULL AS varchar),cast(NULL AS varchar),cast(NULL AS varchar),cast(NULL AS varchar)) +CREATE TABLE core__medicationrequest_dn_medication AS ( + WITH + + system_medicationcodeableconcept_0 AS ( + SELECT DISTINCT + s.id AS id, + u.codeable_concept.code, + u.codeable_concept.display, + u.codeable_concept.system AS code_system + FROM + medicationrequest AS s, + UNNEST(s.medicationcodeableconcept.coding) AS u (codeable_concept) + ), --noqa: LT07 + + union_table AS ( + SELECT + id, + code_system, + code, + display + FROM system_medicationcodeableconcept_0 + ) - AS t ("id","code","code_system","display") + SELECT + id, + code, + code_system, + display + FROM union_table ); + -- ########################################################### diff --git a/cumulus_library/studies/core/reference_sql/builder_observation.sql b/cumulus_library/studies/core/reference_sql/builder_observation.sql index b1846364..0b5f2b28 100644 --- a/cumulus_library/studies/core/reference_sql/builder_observation.sql +++ b/cumulus_library/studies/core/reference_sql/builder_observation.sql @@ -16,8 +16,7 @@ CREATE TABLE core__observation_dn_category AS ( u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - - observation AS s, + observation AS s, UNNEST(s.category) AS cc (cc_row), UNNEST(cc.cc_row.coding) AS u (codeable_concept) ), --noqa: LT07 @@ -52,8 +51,7 @@ CREATE TABLE core__observation_dn_code AS ( u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - - observation AS s, + observation AS s, UNNEST(s.code.coding) AS u (codeable_concept) ), --noqa: LT07 @@ -98,8 +96,7 @@ CREATE TABLE core__observation_dn_valuecodeableconcept AS ( u.codeable_concept.display, u.codeable_concept.system AS code_system FROM - - observation AS s, + observation AS s, UNNEST(s.valuecodeableconcept.coding) AS u (codeable_concept) ), --noqa: LT07 From 81ad97ac9de142a8b5bf722d76c429e96e346831 Mon Sep 17 00:00:00 2001 From: Matt Garber Date: Thu, 21 Mar 2024 10:49:36 -0400 Subject: [PATCH 4/8] discovery cleanup --- .../studies/discovery/code_detection.py | 8 ++-- .../discovery/discovery__code_sources.txt | 43 +++++++++++++++---- tests/test_discovery.py | 14 +++--- 3 files changed, 46 insertions(+), 19 deletions(-) diff --git a/cumulus_library/studies/discovery/code_detection.py b/cumulus_library/studies/discovery/code_detection.py index 487a7fcd..4c5a4951 100644 --- a/cumulus_library/studies/discovery/code_detection.py +++ b/cumulus_library/studies/discovery/code_detection.py @@ -15,8 +15,8 @@ def _check_coding_against_db(self, code_source, schema, cursor): return sql_utils.is_field_populated( schema=schema, source_table=code_source["table_name"], - hierarchy=[(code_source["column_name"], list), ("coding", list)], - expected=[code_source["column_name"], *sql_utils.CODING], + hierarchy=[(code_source["column_name"], list)], + expected=sql_utils.CODEABLE_CONCEPT, cursor=cursor, ) elif code_source["is_bare_coding"]: @@ -30,8 +30,8 @@ def _check_coding_against_db(self, code_source, schema, cursor): return sql_utils.is_field_populated( schema=schema, source_table=code_source["table_name"], - hierarchy=[(code_source["column_name"], dict), ("coding", list)], - expected=[code_source["column_name"], *sql_utils.CODING], + hierarchy=[(code_source["column_name"], dict)], + expected=sql_utils.CODEABLE_CONCEPT, cursor=cursor, ) diff --git a/tests/test_data/discovery/discovery__code_sources.txt b/tests/test_data/discovery/discovery__code_sources.txt index 36f27efd..b96c1885 100644 --- a/tests/test_data/discovery/discovery__code_sources.txt +++ b/tests/test_data/discovery/discovery__code_sources.txt @@ -1,4 +1,4 @@ -condition,category,,, +condition,category,encounter-diagnosis,Encounter Diagnosis,http://terminology.hl7.org/CodeSystem/condition-category condition,code,10509002,Acute bronchitis (disorder),http://snomed.info/sct condition,code,160903007,Full-time employment (finding),http://snomed.info/sct condition,code,195662009,Acute viral pharyngitis (disorder),http://snomed.info/sct @@ -10,21 +10,48 @@ condition,code,44465007,Sprain of ankle,http://snomed.info/sct condition,code,444814009,Viral sinusitis (disorder),http://snomed.info/sct condition,code,73595000,Stress (finding),http://snomed.info/sct condition,code,741062008,Not in labor force (finding),http://snomed.info/sct -documentreference,category,,, -documentreference,type,,, +documentreference,category,clinical-note,Clinical Note,http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category +documentreference,type,34111-5,Emergency department note,http://loinc.org +documentreference,type,51847-2,Evaluation + Plan note,http://loinc.org encounter,class,AMB,None,http://terminology.hl7.org/CodeSystem/v3-ActCode encounter,class,EMER,None,http://terminology.hl7.org/CodeSystem/v3-ActCode encounter,hospitalization.dischargedisposition,,, encounter,priority,,, -encounter,reasoncode,,, +encounter,reasoncode,10509002,Acute bronchitis (disorder),http://snomed.info/sct +encounter,reasoncode,161665007,History of renal transplant (situation),http://snomed.info/sct +encounter,reasoncode,195662009,Acute viral pharyngitis (disorder),http://snomed.info/sct +encounter,reasoncode,271737000,Anemia (disorder),http://snomed.info/sct +encounter,reasoncode,431857002,Chronic kidney disease stage 4 (disorder),http://snomed.info/sct +encounter,reasoncode,444814009,Viral sinusitis (disorder),http://snomed.info/sct +encounter,reasoncode,55680006,Drug overdose,http://snomed.info/sct +encounter,reasoncode,72892002,Normal pregnancy,http://snomed.info/sct +encounter,reasoncode,88805009,Chronic congestive heart failure (disorder),http://snomed.info/sct encounter,servicetype,,, -encounter,type,,, +encounter,type,162673000,General examination of patient (procedure),http://snomed.info/sct +encounter,type,185345009,Encounter for symptom,http://snomed.info/sct +encounter,type,185347001,Encounter for problem,http://snomed.info/sct +encounter,type,185347001,Encounter for problem (procedure),http://snomed.info/sct +encounter,type,185349003,Encounter for check up,http://snomed.info/sct +encounter,type,185349003,Encounter for check up (procedure),http://snomed.info/sct +encounter,type,308335008,Patient encounter procedure,http://snomed.info/sct +encounter,type,371883000,Outpatient procedure,http://snomed.info/sct +encounter,type,410620009,Well child visit (procedure),http://snomed.info/sct +encounter,type,424619006,Prenatal visit,http://snomed.info/sct +encounter,type,439740005,Postoperative follow-up visit (procedure),http://snomed.info/sct +encounter,type,448337001,Telemedicine consultation with patient,http://snomed.info/sct +encounter,type,50849002,Emergency room admission (procedure),http://snomed.info/sct +encounter,type,698314001,Consultation for treatment,http://snomed.info/sct +encounter,type,702927004,Urgent care clinic (environment),http://snomed.info/sct medication,codecodeableconcept ,,, medication,medicationcode,,, -observation,category,,, +observation,category,laboratory,Laboratory,http://terminology.hl7.org/CodeSystem/observation-category observation,code,34533-0,Odor of Urine,http://loinc.org observation,code,5778-6,Color of Urine,http://loinc.org observation,dataabsentreason,,, observation,interpretation,,, -observation,valuecodeableconcept,,, -patient,maritalstatus,,, +observation,valuecodeableconcept,167248002,Urine smell ammoniacal (finding),http://snomed.info/sct +observation,valuecodeableconcept,371254008,Brown color (qualifier value),http://snomed.info/sct +patient,maritalstatus,D,Divorced,http://terminology.hl7.org/CodeSystem/v3-MaritalStatus +patient,maritalstatus,M,Married,http://terminology.hl7.org/CodeSystem/v3-MaritalStatus +patient,maritalstatus,S,Never Married,http://terminology.hl7.org/CodeSystem/v3-MaritalStatus +patient,maritalstatus,W,Widowed,http://terminology.hl7.org/CodeSystem/v3-MaritalStatus diff --git a/tests/test_discovery.py b/tests/test_discovery.py index b0984962..244fc8ed 100644 --- a/tests/test_discovery.py +++ b/tests/test_discovery.py @@ -44,13 +44,13 @@ def test_discovery(tmp_path): table_rows = conftest.get_sorted_table_data(cursor, "discovery__code_sources") # For regenerating test data - with open( - f"{pathlib.Path(__file__).resolve().parents[0]}" - "/test_data/discovery/discovery__code_sources.txt", - "w", - ) as f: - for row in table_rows: - f.write(f"{','.join(str(x) for x in row)}\n") + # with open( + # f"{pathlib.Path(__file__).resolve().parents[0]}" + # "/test_data/discovery/discovery__code_sources.txt", + # "w", + # ) as f: + # for row in table_rows: + # f.write(f"{','.join(str(x) for x in row)}\n") with open( f"{pathlib.Path(__file__).resolve().parents[0]}" From b5214573bdba5dbc4c69e1809c5b835ed1521785 Mon Sep 17 00:00:00 2001 From: Matt Garber Date: Thu, 21 Mar 2024 10:56:10 -0400 Subject: [PATCH 5/8] trimmed unnessecary line in sql_utils --- cumulus_library/template_sql/sql_utils.py | 1 - 1 file changed, 1 deletion(-) diff --git a/cumulus_library/template_sql/sql_utils.py b/cumulus_library/template_sql/sql_utils.py index af6aadf7..7b424346 100644 --- a/cumulus_library/template_sql/sql_utils.py +++ b/cumulus_library/template_sql/sql_utils.py @@ -210,7 +210,6 @@ def is_field_populated( "row_alias": f"{element[0]}_row", }, ) - source_field.append(f"{element[0]}_row") last_table_alias = f"{element[0]}_table" last_row_alias = f"{element[0]}_row" source_field = [last_table_alias, last_row_alias] From 4e2ceaa50b936ee792f1962cfe2baafb5094c3e2 Mon Sep 17 00:00:00 2001 From: Matt Garber Date: Thu, 21 Mar 2024 14:28:40 -0400 Subject: [PATCH 6/8] Light cleanup --- .../studies/core/builder_documentreference.py | 2 +- .../builder_documentreference.sql | 35 ++- .../template_sql/base_templates.py | 4 +- cumulus_library/template_sql/sql_utils.py | 5 +- .../core/core__documentreference.txt | 204 +++++++++--------- tests/test_templates.py | 2 - 6 files changed, 136 insertions(+), 116 deletions(-) diff --git a/cumulus_library/studies/core/builder_documentreference.py b/cumulus_library/studies/core/builder_documentreference.py index 60259684..c5757837 100644 --- a/cumulus_library/studies/core/builder_documentreference.py +++ b/cumulus_library/studies/core/builder_documentreference.py @@ -56,7 +56,7 @@ def prepare_queries( sql_utils.CodingConfig( source_table="documentreference", source_id="id", - column_hierarchy=[("format", dict), ("content", dict)], + column_hierarchy=[("content", list), ("format", dict)], target_table="core__documentreference_dn_format", ), ], diff --git a/cumulus_library/studies/core/reference_sql/builder_documentreference.sql b/cumulus_library/studies/core/reference_sql/builder_documentreference.sql index accbfa3b..8f84c486 100644 --- a/cumulus_library/studies/core/reference_sql/builder_documentreference.sql +++ b/cumulus_library/studies/core/reference_sql/builder_documentreference.sql @@ -98,15 +98,38 @@ CREATE TABLE core__documentreference_dn_category AS ( -- ########################################################### -CREATE TABLE IF NOT EXISTS "main"."core__documentreference_dn_format" -AS ( - SELECT * FROM ( - VALUES - (cast(NULL AS varchar),cast(NULL AS varchar),cast(NULL AS varchar),cast(NULL AS varchar)) +CREATE TABLE core__documentreference_dn_format AS ( + WITH + + system_format_0 AS ( + SELECT DISTINCT + s.id AS id, + u.parent_col.format.code, + u.parent_col.format.display, + u.parent_col.format.system AS code_system + FROM + documentreference AS s, + UNNEST(s.content) AS u (parent_col) + ), --noqa: LT07 + + union_table AS ( + SELECT + id, + code_system, + code, + display + FROM system_format_0 + ) - AS t ("id","code","code_system","display") + SELECT + id, + code, + code_system, + display + FROM union_table ); + -- ########################################################### diff --git a/cumulus_library/template_sql/base_templates.py b/cumulus_library/template_sql/base_templates.py index 40ad5728..85e19926 100644 --- a/cumulus_library/template_sql/base_templates.py +++ b/cumulus_library/template_sql/base_templates.py @@ -74,6 +74,7 @@ def get_codeable_concept_denormalize_query( :param config: a CodableConeptConfig """ + assert len(config.column_hierarchy) <= 2 # If we get a None for code systems, we want one dummy value so the jinja # for loop will do a single pass. This implicitly means that we're not # filtering, so this parameter will be otherwise ignored @@ -86,7 +87,7 @@ def get_codeable_concept_denormalize_query( parent_field=None if len(config.column_hierarchy) == 1 else config.column_hierarchy[0][0], - is_array=True if config.column_hierarchy[0][1] == list else False, + is_array=(config.column_hierarchy[0][1] == list), target_table=config.target_table, filter_priority=config.filter_priority, code_systems=config.code_systems, @@ -107,6 +108,7 @@ def get_coding_denormalize_query( :param config: a CodingConfig """ + assert len(config.column_hierarchy) == 2 # If we get a None for code systems, we want one dummy value so the jinja # for loop will do a single pass. This implicitly means that we're not # filtering, so this parameter will be otherwise ignored diff --git a/cumulus_library/template_sql/sql_utils.py b/cumulus_library/template_sql/sql_utils.py index 7b424346..a11b8e93 100644 --- a/cumulus_library/template_sql/sql_utils.py +++ b/cumulus_library/template_sql/sql_utils.py @@ -234,7 +234,6 @@ def _check_schema_if_exists( cursor: databases.DatabaseCursor, source_table: str, source_col: str, - target_field: str, expected=None, ) -> bool: """Validation check for a column existing, and having the expected schema @@ -243,9 +242,7 @@ def _check_schema_if_exists( :param cursor: a PEP-249 compliant database cursor :param source_table: The table to query against :param source_col: The column to check the schema against - :param target_field: The name of the nested value to check for inside the - schema of source_col - :param expected: a list of elements that should be present in target_field. + :param expected: a list of elements that should be present in source_col. If none, we assume it is a CodeableConcept. :returns: a boolean indicating if the schema was found. """ diff --git a/tests/test_data/core/core__documentreference.txt b/tests/test_data/core/core__documentreference.txt index 36b460a9..1b65ef5e 100644 --- a/tests/test_data/core/core__documentreference.txt +++ b/tests/test_data/core/core__documentreference.txt @@ -1,102 +1,102 @@ -('351ea353-4dc6-b0a8-2a70-0e5478e8171e', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/cb8c0665-30ee-479c-8994-d29f1a6848b0', 'Encounter/1d679c3a-2765-5e13-e2a3-4bd76a898fc6', 'DocumentReference/351ea353-4dc6-b0a8-2a70-0e5478e8171e') -('351ea353-4dc6-b0a8-2a70-0e5478e8171e', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/cb8c0665-30ee-479c-8994-d29f1a6848b0', 'Encounter/1d679c3a-2765-5e13-e2a3-4bd76a898fc6', 'DocumentReference/351ea353-4dc6-b0a8-2a70-0e5478e8171e') -('36d0d49a-6346-2856-d614-3f0a1ae85685', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/f9399f0d-5401-09f3-d4ff-89b1aa51b9c8', 'Encounter/6a952afd-3be5-e27e-9e05-5a1e085e34d0', 'DocumentReference/36d0d49a-6346-2856-d614-3f0a1ae85685') -('36d0d49a-6346-2856-d614-3f0a1ae85685', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/f9399f0d-5401-09f3-d4ff-89b1aa51b9c8', 'Encounter/6a952afd-3be5-e27e-9e05-5a1e085e34d0', 'DocumentReference/36d0d49a-6346-2856-d614-3f0a1ae85685') -('37c2d2ba-1976-1167-9bf6-7eb17f3fa35f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/8022fbbe-aaa4-056c-d0f5-ec074bf0656c', 'Encounter/e922a884-7039-a171-a65e-78051fe7afe6', 'DocumentReference/37c2d2ba-1976-1167-9bf6-7eb17f3fa35f') -('37c2d2ba-1976-1167-9bf6-7eb17f3fa35f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/8022fbbe-aaa4-056c-d0f5-ec074bf0656c', 'Encounter/e922a884-7039-a171-a65e-78051fe7afe6', 'DocumentReference/37c2d2ba-1976-1167-9bf6-7eb17f3fa35f') -('3ebf29a1-a116-9d17-5e9a-bad0d6c2d756', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/0b052286-9534-99a8-8d5e-06c2c04a7df7', 'Encounter/e5dabcb6-1d7a-7467-dbba-b864d0d5f5b0', 'DocumentReference/3ebf29a1-a116-9d17-5e9a-bad0d6c2d756') -('3ebf29a1-a116-9d17-5e9a-bad0d6c2d756', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/0b052286-9534-99a8-8d5e-06c2c04a7df7', 'Encounter/e5dabcb6-1d7a-7467-dbba-b864d0d5f5b0', 'DocumentReference/3ebf29a1-a116-9d17-5e9a-bad0d6c2d756') -('3f0e9271-a486-797d-978a-fb2d32d37d47', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 21), datetime.date(2018, 6, 18), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/a46846ca-3f95-2cbb-3a9d-5eae150a0273', 'Encounter/5c3450fb-12f0-08f3-6e4d-8a5e433e19a4', 'DocumentReference/3f0e9271-a486-797d-978a-fb2d32d37d47') -('3f0e9271-a486-797d-978a-fb2d32d37d47', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 21), datetime.date(2018, 6, 18), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/a46846ca-3f95-2cbb-3a9d-5eae150a0273', 'Encounter/5c3450fb-12f0-08f3-6e4d-8a5e433e19a4', 'DocumentReference/3f0e9271-a486-797d-978a-fb2d32d37d47') -('3f578a1b-f50a-9333-3030-306982950658', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/3cf7af45-2bee-aa9c-d524-40b487149d60', 'Encounter/d2782687-6885-037c-957d-579fbd681d2a', 'DocumentReference/3f578a1b-f50a-9333-3030-306982950658') -('3f578a1b-f50a-9333-3030-306982950658', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/3cf7af45-2bee-aa9c-d524-40b487149d60', 'Encounter/d2782687-6885-037c-957d-579fbd681d2a', 'DocumentReference/3f578a1b-f50a-9333-3030-306982950658') -('406679b2-a02c-0003-3b17-56ba373fccff', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/0734762a-9db6-22fc-b595-c3e472bb2a9a', 'Encounter/2f55edb9-a906-0b40-e183-89b1d65d1aa1', 'DocumentReference/406679b2-a02c-0003-3b17-56ba373fccff') -('406679b2-a02c-0003-3b17-56ba373fccff', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/0734762a-9db6-22fc-b595-c3e472bb2a9a', 'Encounter/2f55edb9-a906-0b40-e183-89b1d65d1aa1', 'DocumentReference/406679b2-a02c-0003-3b17-56ba373fccff') -('41eb62dd-7032-e98d-84c6-d494ad8c877b', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, 'final', None, datetime.date(2018, 7, 31), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/2a0e1946-acf6-5a7e-9399-a9cbc4730199', 'Encounter/aabb3ac3-c4a3-f613-9507-63280adb9209', 'DocumentReference/41eb62dd-7032-e98d-84c6-d494ad8c877b') -('41eb62dd-7032-e98d-84c6-d494ad8c877b', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, 'final', None, datetime.date(2018, 7, 31), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/2a0e1946-acf6-5a7e-9399-a9cbc4730199', 'Encounter/aabb3ac3-c4a3-f613-9507-63280adb9209', 'DocumentReference/41eb62dd-7032-e98d-84c6-d494ad8c877b') -('4390dbd1-3bdf-e516-9fe0-a8180181507f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, 'amended', None, datetime.date(2018, 6, 3), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/e80dda2c-a260-dbf7-3167-bf0945f3a91d', 'Encounter/029d1814-d7bf-0624-524d-7ccda5f320f6', 'DocumentReference/4390dbd1-3bdf-e516-9fe0-a8180181507f') -('4390dbd1-3bdf-e516-9fe0-a8180181507f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, 'amended', None, datetime.date(2018, 6, 3), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/e80dda2c-a260-dbf7-3167-bf0945f3a91d', 'Encounter/029d1814-d7bf-0624-524d-7ccda5f320f6', 'DocumentReference/4390dbd1-3bdf-e516-9fe0-a8180181507f') -('4390dbd1-3bdf-e516-9fe0-a8180181507f-error', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, 'entered-in-error', None, datetime.date(2018, 6, 3), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/e80dda2c-a260-dbf7-3167-bf0945f3a91d', 'Encounter/029d1814-d7bf-0624-524d-7ccda5f320f6', 'DocumentReference/4390dbd1-3bdf-e516-9fe0-a8180181507f-error') -('4390dbd1-3bdf-e516-9fe0-a8180181507f-error', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, 'entered-in-error', None, datetime.date(2018, 6, 3), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/e80dda2c-a260-dbf7-3167-bf0945f3a91d', 'Encounter/029d1814-d7bf-0624-524d-7ccda5f320f6', 'DocumentReference/4390dbd1-3bdf-e516-9fe0-a8180181507f-error') -('4439aa6e-fbc2-21a1-208e-095907104a65', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 30), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/82b8a670-4700-30e8-24a0-b83efa3c5e0a', 'Encounter/75b68644-535d-bdc1-4c31-aa9fe7e1822f', 'DocumentReference/4439aa6e-fbc2-21a1-208e-095907104a65') -('4439aa6e-fbc2-21a1-208e-095907104a65', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 30), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/82b8a670-4700-30e8-24a0-b83efa3c5e0a', 'Encounter/75b68644-535d-bdc1-4c31-aa9fe7e1822f', 'DocumentReference/4439aa6e-fbc2-21a1-208e-095907104a65') -('45160ef5-42e8-7239-6633-904308273198', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/3627adb8-f741-acf3-2dd6-10f3bcbe1077', 'Encounter/bca7cabc-b2fc-8a08-c69b-5bc0afa20d80', 'DocumentReference/45160ef5-42e8-7239-6633-904308273198') -('45160ef5-42e8-7239-6633-904308273198', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/3627adb8-f741-acf3-2dd6-10f3bcbe1077', 'Encounter/bca7cabc-b2fc-8a08-c69b-5bc0afa20d80', 'DocumentReference/45160ef5-42e8-7239-6633-904308273198') -('4711ca43-989d-a8f9-5f32-0102640804cf', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/d3c0274f-f42b-8d2b-15f2-82331e723383', 'Encounter/6565ef5c-30b9-8697-6ca6-2b77894d5437', 'DocumentReference/4711ca43-989d-a8f9-5f32-0102640804cf') -('4711ca43-989d-a8f9-5f32-0102640804cf', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/d3c0274f-f42b-8d2b-15f2-82331e723383', 'Encounter/6565ef5c-30b9-8697-6ca6-2b77894d5437', 'DocumentReference/4711ca43-989d-a8f9-5f32-0102640804cf') -('48693636-4eec-ad3d-b71d-8f650bd0a6f1', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/c7ad408d-fcae-b54a-eb1d-26d48f7a5f84', 'Encounter/02eb4e14-1a6f-d968-2c26-c0cf5023afe0', 'DocumentReference/48693636-4eec-ad3d-b71d-8f650bd0a6f1') -('48693636-4eec-ad3d-b71d-8f650bd0a6f1', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/c7ad408d-fcae-b54a-eb1d-26d48f7a5f84', 'Encounter/02eb4e14-1a6f-d968-2c26-c0cf5023afe0', 'DocumentReference/48693636-4eec-ad3d-b71d-8f650bd0a6f1') -('48933dd8-3fcf-416e-89ca-27851e45391f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 29), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/7cef0e6f-9aea-4079-dfc6-18a96454708e', 'Encounter/d735c414-9dd3-c9b1-285c-8da79a7fbbdf', 'DocumentReference/48933dd8-3fcf-416e-89ca-27851e45391f') -('48933dd8-3fcf-416e-89ca-27851e45391f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 29), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/7cef0e6f-9aea-4079-dfc6-18a96454708e', 'Encounter/d735c414-9dd3-c9b1-285c-8da79a7fbbdf', 'DocumentReference/48933dd8-3fcf-416e-89ca-27851e45391f') -('4b2e99d5-d4c2-fd1f-a5fd-96fe9546b58a', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/6385ddd7-2639-6505-3789-0521b8f66c8b', 'Encounter/fd0754a4-e96d-cba7-b3c0-77697a09c86e', 'DocumentReference/4b2e99d5-d4c2-fd1f-a5fd-96fe9546b58a') -('4b2e99d5-d4c2-fd1f-a5fd-96fe9546b58a', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/6385ddd7-2639-6505-3789-0521b8f66c8b', 'Encounter/fd0754a4-e96d-cba7-b3c0-77697a09c86e', 'DocumentReference/4b2e99d5-d4c2-fd1f-a5fd-96fe9546b58a') -('99b390f4-1bcb-21ec-85d5-85cbb74e86ae', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/9eaa056b-1efc-0cc8-70ff-62c8f704cc13', 'Encounter/5c994000-aa78-2be5-e6cf-99f230d50c2f', 'DocumentReference/99b390f4-1bcb-21ec-85d5-85cbb74e86ae') -('99b390f4-1bcb-21ec-85d5-85cbb74e86ae', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/9eaa056b-1efc-0cc8-70ff-62c8f704cc13', 'Encounter/5c994000-aa78-2be5-e6cf-99f230d50c2f', 'DocumentReference/99b390f4-1bcb-21ec-85d5-85cbb74e86ae') -('99d49a34-c515-23a1-c3e4-ef73c3cef727', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 26), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/cc9fb8e2-fe52-b72a-aebb-9d10260f121b', 'Encounter/683b04eb-663a-849f-715f-4ccd70bf1524', 'DocumentReference/99d49a34-c515-23a1-c3e4-ef73c3cef727') -('99d49a34-c515-23a1-c3e4-ef73c3cef727', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 26), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/cc9fb8e2-fe52-b72a-aebb-9d10260f121b', 'Encounter/683b04eb-663a-849f-715f-4ccd70bf1524', 'DocumentReference/99d49a34-c515-23a1-c3e4-ef73c3cef727') -('99e26f8b-a5a2-ad5e-713a-16266b5991a1', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/1c498b42-61fd-6341-69c3-053f6e4fe404', 'Encounter/e613f29d-7505-6f2e-a1f5-bfbec300752d', 'DocumentReference/99e26f8b-a5a2-ad5e-713a-16266b5991a1') -('99e26f8b-a5a2-ad5e-713a-16266b5991a1', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/1c498b42-61fd-6341-69c3-053f6e4fe404', 'Encounter/e613f29d-7505-6f2e-a1f5-bfbec300752d', 'DocumentReference/99e26f8b-a5a2-ad5e-713a-16266b5991a1') -('9a50a40a-8099-5ab5-0903-1ba65d8c0905', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/24906e2c-e556-71dc-23d9-3e1d5fb08986', 'Encounter/1154d05c-8727-9373-4224-25b9fdba9ab3', 'DocumentReference/9a50a40a-8099-5ab5-0903-1ba65d8c0905') -('9a50a40a-8099-5ab5-0903-1ba65d8c0905', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/24906e2c-e556-71dc-23d9-3e1d5fb08986', 'Encounter/1154d05c-8727-9373-4224-25b9fdba9ab3', 'DocumentReference/9a50a40a-8099-5ab5-0903-1ba65d8c0905') -('9ca118c6-e354-5588-3cdc-77ee3b3c8711', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/2da1bee2-2bc2-4511-84e1-42860310e2fb', 'Encounter/d5f342b7-017c-f2e7-8697-5a038c91518e', 'DocumentReference/9ca118c6-e354-5588-3cdc-77ee3b3c8711') -('9ca118c6-e354-5588-3cdc-77ee3b3c8711', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/2da1bee2-2bc2-4511-84e1-42860310e2fb', 'Encounter/d5f342b7-017c-f2e7-8697-5a038c91518e', 'DocumentReference/9ca118c6-e354-5588-3cdc-77ee3b3c8711') -('a1b69e45-11f8-a49f-170e-32004c70e842', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 11), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/5ce2e599-fb6e-9b4d-3c2e-87310619b957', 'Encounter/4b03a408-6694-88e3-0e63-3ee464ecd6cd', 'DocumentReference/a1b69e45-11f8-a49f-170e-32004c70e842') -('a1b69e45-11f8-a49f-170e-32004c70e842', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 11), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/5ce2e599-fb6e-9b4d-3c2e-87310619b957', 'Encounter/4b03a408-6694-88e3-0e63-3ee464ecd6cd', 'DocumentReference/a1b69e45-11f8-a49f-170e-32004c70e842') -('a3964c82-0605-c2b2-97dc-0de17a1ec0ef', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 17), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/7f941bcc-e7b2-99e1-585f-129d0ef1c13d', 'Encounter/65f8fdca-a949-80a0-8072-094e9aaee474', 'DocumentReference/a3964c82-0605-c2b2-97dc-0de17a1ec0ef') -('a3964c82-0605-c2b2-97dc-0de17a1ec0ef', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 17), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/7f941bcc-e7b2-99e1-585f-129d0ef1c13d', 'Encounter/65f8fdca-a949-80a0-8072-094e9aaee474', 'DocumentReference/a3964c82-0605-c2b2-97dc-0de17a1ec0ef') -('a5231f35-ad14-580e-1888-55c1b383aa11', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/3ae095ec-8fe0-133b-36d4-8785a6ad8df3', 'Encounter/75312bd2-d5ac-c62e-c9df-0004783725c7', 'DocumentReference/a5231f35-ad14-580e-1888-55c1b383aa11') -('a5231f35-ad14-580e-1888-55c1b383aa11', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/3ae095ec-8fe0-133b-36d4-8785a6ad8df3', 'Encounter/75312bd2-d5ac-c62e-c9df-0004783725c7', 'DocumentReference/a5231f35-ad14-580e-1888-55c1b383aa11') -('a59ca653-b95d-09d2-9fa5-a1b492d85a5f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 28), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/c20e5afd-30df-ac3d-6684-cc29438a9bc4', 'Encounter/b864bcd8-14e0-8bec-b7cc-f8629d91470e', 'DocumentReference/a59ca653-b95d-09d2-9fa5-a1b492d85a5f') -('a59ca653-b95d-09d2-9fa5-a1b492d85a5f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 28), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/c20e5afd-30df-ac3d-6684-cc29438a9bc4', 'Encounter/b864bcd8-14e0-8bec-b7cc-f8629d91470e', 'DocumentReference/a59ca653-b95d-09d2-9fa5-a1b492d85a5f') -('a69150c5-2fbe-2284-1eb5-e11146858a22', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 1), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/9c8d8539-0b1e-73e2-b64f-83f1ea601fa4', 'Encounter/f2752dd7-1bf1-739d-dd8c-40122d0b63bc', 'DocumentReference/a69150c5-2fbe-2284-1eb5-e11146858a22') -('a69150c5-2fbe-2284-1eb5-e11146858a22', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 1), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/9c8d8539-0b1e-73e2-b64f-83f1ea601fa4', 'Encounter/f2752dd7-1bf1-739d-dd8c-40122d0b63bc', 'DocumentReference/a69150c5-2fbe-2284-1eb5-e11146858a22') -('a7115116-f8da-3960-e3ed-f1f0d89646c3', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 2), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/8877ef1f-7cd7-3242-d7f0-73cf3f7165f4', 'Encounter/299b6495-3fe7-8db3-c494-6e1ce8b7986d', 'DocumentReference/a7115116-f8da-3960-e3ed-f1f0d89646c3') -('a7115116-f8da-3960-e3ed-f1f0d89646c3', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 2), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/8877ef1f-7cd7-3242-d7f0-73cf3f7165f4', 'Encounter/299b6495-3fe7-8db3-c494-6e1ce8b7986d', 'DocumentReference/a7115116-f8da-3960-e3ed-f1f0d89646c3') -('a79da4dd-83bc-5b6a-db34-bd35b3acbd2c', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 6), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/19158de4-66a2-f70f-e3bf-4396b312c8f1', 'Encounter/ed151e04-3dd6-8cb7-a3e5-777c8a8667f1', 'DocumentReference/a79da4dd-83bc-5b6a-db34-bd35b3acbd2c') -('a79da4dd-83bc-5b6a-db34-bd35b3acbd2c', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 6), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/19158de4-66a2-f70f-e3bf-4396b312c8f1', 'Encounter/ed151e04-3dd6-8cb7-a3e5-777c8a8667f1', 'DocumentReference/a79da4dd-83bc-5b6a-db34-bd35b3acbd2c') -('a95df5ea-7005-9e98-e97a-1ade6967b585', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 16), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/16be855b-ece2-8b96-1ef9-a4d93adf3289', 'Encounter/83d0d564-3bbf-48eb-7445-bd2b81130671', 'DocumentReference/a95df5ea-7005-9e98-e97a-1ade6967b585') -('a95df5ea-7005-9e98-e97a-1ade6967b585', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 16), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/16be855b-ece2-8b96-1ef9-a4d93adf3289', 'Encounter/83d0d564-3bbf-48eb-7445-bd2b81130671', 'DocumentReference/a95df5ea-7005-9e98-e97a-1ade6967b585') -('a96ba3b7-a461-5849-1881-d372e0460ccc', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 14), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/26a3984f-b2a8-e67f-7abc-ff147a0e6e35', 'Encounter/79d8f213-7847-646b-8a66-5da208cc1c27', 'DocumentReference/a96ba3b7-a461-5849-1881-d372e0460ccc') -('a96ba3b7-a461-5849-1881-d372e0460ccc', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 14), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/26a3984f-b2a8-e67f-7abc-ff147a0e6e35', 'Encounter/79d8f213-7847-646b-8a66-5da208cc1c27', 'DocumentReference/a96ba3b7-a461-5849-1881-d372e0460ccc') -('ac0439bc-e450-d339-da6d-5ead96d8b346', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 30), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/2858705f-5af1-9869-4d94-894e09a9f99a', 'Encounter/de9d67de-6ae3-32f7-20f2-e719ae23a9a3', 'DocumentReference/ac0439bc-e450-d339-da6d-5ead96d8b346') -('ac0439bc-e450-d339-da6d-5ead96d8b346', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 30), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/2858705f-5af1-9869-4d94-894e09a9f99a', 'Encounter/de9d67de-6ae3-32f7-20f2-e719ae23a9a3', 'DocumentReference/ac0439bc-e450-d339-da6d-5ead96d8b346') -('ad2bee76-6e59-5d8b-21ed-b30cdb784198', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 9), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/e455ca3f-fc16-6ffc-297a-adc27e2db183', 'Encounter/98d4bd14-d78e-debb-e7dc-2df7786aedf3', 'DocumentReference/ad2bee76-6e59-5d8b-21ed-b30cdb784198') -('ad2bee76-6e59-5d8b-21ed-b30cdb784198', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 9), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/e455ca3f-fc16-6ffc-297a-adc27e2db183', 'Encounter/98d4bd14-d78e-debb-e7dc-2df7786aedf3', 'DocumentReference/ad2bee76-6e59-5d8b-21ed-b30cdb784198') -('b1f5c114-8e28-08c0-0193-0855aa10c97f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/c7c5c028-f1fb-962b-8db2-dfd4c6d6b02a', 'Encounter/aa890974-162f-5906-dc71-2bb6d2185314', 'DocumentReference/b1f5c114-8e28-08c0-0193-0855aa10c97f') -('b1f5c114-8e28-08c0-0193-0855aa10c97f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/c7c5c028-f1fb-962b-8db2-dfd4c6d6b02a', 'Encounter/aa890974-162f-5906-dc71-2bb6d2185314', 'DocumentReference/b1f5c114-8e28-08c0-0193-0855aa10c97f') -('b2896621-57ef-1ad3-91c5-389dce96973b', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 7), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/ac91b90d-97e4-4fc5-41cd-036bac49e6e8', 'Encounter/dc5ed645-3979-e765-3e03-6ba2173027c3', 'DocumentReference/b2896621-57ef-1ad3-91c5-389dce96973b') -('b2896621-57ef-1ad3-91c5-389dce96973b', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 7), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/ac91b90d-97e4-4fc5-41cd-036bac49e6e8', 'Encounter/dc5ed645-3979-e765-3e03-6ba2173027c3', 'DocumentReference/b2896621-57ef-1ad3-91c5-389dce96973b') -('b3357397-9f4c-7d00-06af-18f03c63d583', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/c1bfec36-dc2c-afc8-c767-3d35ed2bf6f0', 'Encounter/8ff1dc01-5a28-b2d8-3b42-4b7a7d539970', 'DocumentReference/b3357397-9f4c-7d00-06af-18f03c63d583') -('b3357397-9f4c-7d00-06af-18f03c63d583', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/c1bfec36-dc2c-afc8-c767-3d35ed2bf6f0', 'Encounter/8ff1dc01-5a28-b2d8-3b42-4b7a7d539970', 'DocumentReference/b3357397-9f4c-7d00-06af-18f03c63d583') -('b339c2e8-35eb-1838-7eea-5a04c81695df', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/267fc42d-cd9e-8527-1f9e-887fe7776147', 'Encounter/4c4d0730-201f-5b75-c657-8d0de09cc28f', 'DocumentReference/b339c2e8-35eb-1838-7eea-5a04c81695df') -('b339c2e8-35eb-1838-7eea-5a04c81695df', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/267fc42d-cd9e-8527-1f9e-887fe7776147', 'Encounter/4c4d0730-201f-5b75-c657-8d0de09cc28f', 'DocumentReference/b339c2e8-35eb-1838-7eea-5a04c81695df') -('b39532e8-ee15-a7c4-cac5-353a8be67d15', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 8), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/6a883108-7b87-120b-d163-d369336e04e5', 'Encounter/2b1ee164-6c87-420d-a9e2-6c235ebeef71', 'DocumentReference/b39532e8-ee15-a7c4-cac5-353a8be67d15') -('b39532e8-ee15-a7c4-cac5-353a8be67d15', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 8), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/6a883108-7b87-120b-d163-d369336e04e5', 'Encounter/2b1ee164-6c87-420d-a9e2-6c235ebeef71', 'DocumentReference/b39532e8-ee15-a7c4-cac5-353a8be67d15') -('b44d277c-7c09-a39b-97e9-1e96d71b6978', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/7bf52d54-0d2a-265a-15aa-eeed7aaf4af6', 'Encounter/ba84689e-2f9f-7cea-af1f-d69ffdd3a3eb', 'DocumentReference/b44d277c-7c09-a39b-97e9-1e96d71b6978') -('b44d277c-7c09-a39b-97e9-1e96d71b6978', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/7bf52d54-0d2a-265a-15aa-eeed7aaf4af6', 'Encounter/ba84689e-2f9f-7cea-af1f-d69ffdd3a3eb', 'DocumentReference/b44d277c-7c09-a39b-97e9-1e96d71b6978') -('b58f7768-64be-6c0f-1b82-3deffdef1076', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/a28be3e1-a6bd-7df4-fc81-1140848f8453', 'Encounter/91f94a9d-69a7-e30a-cd1a-68c52dc01e70', 'DocumentReference/b58f7768-64be-6c0f-1b82-3deffdef1076') -('b58f7768-64be-6c0f-1b82-3deffdef1076', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/a28be3e1-a6bd-7df4-fc81-1140848f8453', 'Encounter/91f94a9d-69a7-e30a-cd1a-68c52dc01e70', 'DocumentReference/b58f7768-64be-6c0f-1b82-3deffdef1076') -('b73493d0-e2f4-9aa6-cdad-920f7c126d6c', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 16), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/50f8b42e-17a6-e932-8546-da94004c597c', 'Encounter/37604257-be1a-120f-81ee-336f81603f92', 'DocumentReference/b73493d0-e2f4-9aa6-cdad-920f7c126d6c') -('b73493d0-e2f4-9aa6-cdad-920f7c126d6c', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 16), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/50f8b42e-17a6-e932-8546-da94004c597c', 'Encounter/37604257-be1a-120f-81ee-336f81603f92', 'DocumentReference/b73493d0-e2f4-9aa6-cdad-920f7c126d6c') -('b7b68006-53d5-b823-d193-56b262f45e8b', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/ad3ed58a-5645-af0a-eeca-ab543123a8aa', 'Encounter/03e34b19-2889-b828-792d-2a83400c55be', 'DocumentReference/b7b68006-53d5-b823-d193-56b262f45e8b') -('b7b68006-53d5-b823-d193-56b262f45e8b', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/ad3ed58a-5645-af0a-eeca-ab543123a8aa', 'Encounter/03e34b19-2889-b828-792d-2a83400c55be', 'DocumentReference/b7b68006-53d5-b823-d193-56b262f45e8b') -('b953a85f-f18b-d7a3-8974-ba44e0a3141c', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 5), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/a5bc08ea-9462-c4f5-1bd2-ff342598ac99', 'Encounter/f964be66-3fcd-95c8-0021-71c7d24c91b7', 'DocumentReference/b953a85f-f18b-d7a3-8974-ba44e0a3141c') -('b953a85f-f18b-d7a3-8974-ba44e0a3141c', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 5), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/a5bc08ea-9462-c4f5-1bd2-ff342598ac99', 'Encounter/f964be66-3fcd-95c8-0021-71c7d24c91b7', 'DocumentReference/b953a85f-f18b-d7a3-8974-ba44e0a3141c') -('b985a70c-9504-b7b3-0707-f8381ba77976', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/149de67a-2809-59a8-bfa2-36df509021dc', 'Encounter/beb26500-4ccd-ce0a-44f6-74f44be5fafe', 'DocumentReference/b985a70c-9504-b7b3-0707-f8381ba77976') -('b985a70c-9504-b7b3-0707-f8381ba77976', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/149de67a-2809-59a8-bfa2-36df509021dc', 'Encounter/beb26500-4ccd-ce0a-44f6-74f44be5fafe', 'DocumentReference/b985a70c-9504-b7b3-0707-f8381ba77976') -('ba0abbd6-49a9-95fa-2396-7118c56da8c6', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 12), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/9b17654f-a902-3d56-9000-4ade3dd3059f', 'Encounter/ca45bbef-ef2a-3b3c-ea5e-76bcd5865780', 'DocumentReference/ba0abbd6-49a9-95fa-2396-7118c56da8c6') -('ba0abbd6-49a9-95fa-2396-7118c56da8c6', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 12), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/9b17654f-a902-3d56-9000-4ade3dd3059f', 'Encounter/ca45bbef-ef2a-3b3c-ea5e-76bcd5865780', 'DocumentReference/ba0abbd6-49a9-95fa-2396-7118c56da8c6') -('bcbaa9d3-d7cf-3f5f-44d3-32c8a267f991', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/17fde357-dcc9-af8b-a8d3-4bd213afeb22', 'Encounter/32d0ae2d-1be8-9e90-a4da-4c222abd88a9', 'DocumentReference/bcbaa9d3-d7cf-3f5f-44d3-32c8a267f991') -('bcbaa9d3-d7cf-3f5f-44d3-32c8a267f991', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/17fde357-dcc9-af8b-a8d3-4bd213afeb22', 'Encounter/32d0ae2d-1be8-9e90-a4da-4c222abd88a9', 'DocumentReference/bcbaa9d3-d7cf-3f5f-44d3-32c8a267f991') -('bd60a52b-65b9-f26d-03e4-282850509f03', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/51032f44-d514-26e9-3e85-e956561c076e', 'Encounter/d73ed087-e0ae-78e0-7a05-1bac1060c476', 'DocumentReference/bd60a52b-65b9-f26d-03e4-282850509f03') -('bd60a52b-65b9-f26d-03e4-282850509f03', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/51032f44-d514-26e9-3e85-e956561c076e', 'Encounter/d73ed087-e0ae-78e0-7a05-1bac1060c476', 'DocumentReference/bd60a52b-65b9-f26d-03e4-282850509f03') -('bfddb0ff-1296-107e-76ca-14b4a14db9ce', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/26baae20-c8c5-003a-ab6b-ebcc49be20db', 'Encounter/c6ec2350-43d4-abab-2e84-4d2aadb337a7', 'DocumentReference/bfddb0ff-1296-107e-76ca-14b4a14db9ce') -('bfddb0ff-1296-107e-76ca-14b4a14db9ce', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/26baae20-c8c5-003a-ab6b-ebcc49be20db', 'Encounter/c6ec2350-43d4-abab-2e84-4d2aadb337a7', 'DocumentReference/bfddb0ff-1296-107e-76ca-14b4a14db9ce') -('c18dbe84-be31-cee5-1f2e-cf163cdd3e3f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 27), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/a5b171a7-9b28-20e7-86a7-936ecbf55f36', 'Encounter/c4605953-3103-ede6-e0c0-e0588e6f019e', 'DocumentReference/c18dbe84-be31-cee5-1f2e-cf163cdd3e3f') -('c18dbe84-be31-cee5-1f2e-cf163cdd3e3f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 27), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/a5b171a7-9b28-20e7-86a7-936ecbf55f36', 'Encounter/c4605953-3103-ede6-e0c0-e0588e6f019e', 'DocumentReference/c18dbe84-be31-cee5-1f2e-cf163cdd3e3f') -('c6598486-8276-b44a-286e-b376143f7efc', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 25), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/47c37c92-5932-9cfe-66be-208556780fe0', 'Encounter/b5974881-ae62-ddd6-b905-8c86c1ca9e33', 'DocumentReference/c6598486-8276-b44a-286e-b376143f7efc') -('c6598486-8276-b44a-286e-b376143f7efc', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 25), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/47c37c92-5932-9cfe-66be-208556780fe0', 'Encounter/b5974881-ae62-ddd6-b905-8c86c1ca9e33', 'DocumentReference/c6598486-8276-b44a-286e-b376143f7efc') -('c6c64129-9dfa-840d-3309-a5590cc74f2e', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/ad239efc-637c-e428-c829-b87e700d5446', 'Encounter/366df7d3-2ea9-db22-7cdd-60fa8a5c45ca', 'DocumentReference/c6c64129-9dfa-840d-3309-a5590cc74f2e') -('c6c64129-9dfa-840d-3309-a5590cc74f2e', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), None, 'Patient/ad239efc-637c-e428-c829-b87e700d5446', 'Encounter/366df7d3-2ea9-db22-7cdd-60fa8a5c45ca', 'DocumentReference/c6c64129-9dfa-840d-3309-a5590cc74f2e') -('c84e67e9-4ea8-700b-9f2b-c0179e803d4f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/dffa62dc-8ec2-1cd6-ee75-f9156a5283fe', 'Encounter/11381dc6-0e06-da55-0735-d1e7bbf8bb35', 'DocumentReference/c84e67e9-4ea8-700b-9f2b-c0179e803d4f') -('c84e67e9-4ea8-700b-9f2b-c0179e803d4f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), None, 'Patient/dffa62dc-8ec2-1cd6-ee75-f9156a5283fe', 'Encounter/11381dc6-0e06-da55-0735-d1e7bbf8bb35', 'DocumentReference/c84e67e9-4ea8-700b-9f2b-c0179e803d4f') +('351ea353-4dc6-b0a8-2a70-0e5478e8171e', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/cb8c0665-30ee-479c-8994-d29f1a6848b0', 'Encounter/1d679c3a-2765-5e13-e2a3-4bd76a898fc6', 'DocumentReference/351ea353-4dc6-b0a8-2a70-0e5478e8171e') +('351ea353-4dc6-b0a8-2a70-0e5478e8171e', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/cb8c0665-30ee-479c-8994-d29f1a6848b0', 'Encounter/1d679c3a-2765-5e13-e2a3-4bd76a898fc6', 'DocumentReference/351ea353-4dc6-b0a8-2a70-0e5478e8171e') +('36d0d49a-6346-2856-d614-3f0a1ae85685', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/f9399f0d-5401-09f3-d4ff-89b1aa51b9c8', 'Encounter/6a952afd-3be5-e27e-9e05-5a1e085e34d0', 'DocumentReference/36d0d49a-6346-2856-d614-3f0a1ae85685') +('36d0d49a-6346-2856-d614-3f0a1ae85685', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/f9399f0d-5401-09f3-d4ff-89b1aa51b9c8', 'Encounter/6a952afd-3be5-e27e-9e05-5a1e085e34d0', 'DocumentReference/36d0d49a-6346-2856-d614-3f0a1ae85685') +('37c2d2ba-1976-1167-9bf6-7eb17f3fa35f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/8022fbbe-aaa4-056c-d0f5-ec074bf0656c', 'Encounter/e922a884-7039-a171-a65e-78051fe7afe6', 'DocumentReference/37c2d2ba-1976-1167-9bf6-7eb17f3fa35f') +('37c2d2ba-1976-1167-9bf6-7eb17f3fa35f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/8022fbbe-aaa4-056c-d0f5-ec074bf0656c', 'Encounter/e922a884-7039-a171-a65e-78051fe7afe6', 'DocumentReference/37c2d2ba-1976-1167-9bf6-7eb17f3fa35f') +('3ebf29a1-a116-9d17-5e9a-bad0d6c2d756', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/0b052286-9534-99a8-8d5e-06c2c04a7df7', 'Encounter/e5dabcb6-1d7a-7467-dbba-b864d0d5f5b0', 'DocumentReference/3ebf29a1-a116-9d17-5e9a-bad0d6c2d756') +('3ebf29a1-a116-9d17-5e9a-bad0d6c2d756', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/0b052286-9534-99a8-8d5e-06c2c04a7df7', 'Encounter/e5dabcb6-1d7a-7467-dbba-b864d0d5f5b0', 'DocumentReference/3ebf29a1-a116-9d17-5e9a-bad0d6c2d756') +('3f0e9271-a486-797d-978a-fb2d32d37d47', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 21), datetime.date(2018, 6, 18), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/a46846ca-3f95-2cbb-3a9d-5eae150a0273', 'Encounter/5c3450fb-12f0-08f3-6e4d-8a5e433e19a4', 'DocumentReference/3f0e9271-a486-797d-978a-fb2d32d37d47') +('3f0e9271-a486-797d-978a-fb2d32d37d47', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 21), datetime.date(2018, 6, 18), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/a46846ca-3f95-2cbb-3a9d-5eae150a0273', 'Encounter/5c3450fb-12f0-08f3-6e4d-8a5e433e19a4', 'DocumentReference/3f0e9271-a486-797d-978a-fb2d32d37d47') +('3f578a1b-f50a-9333-3030-306982950658', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/3cf7af45-2bee-aa9c-d524-40b487149d60', 'Encounter/d2782687-6885-037c-957d-579fbd681d2a', 'DocumentReference/3f578a1b-f50a-9333-3030-306982950658') +('3f578a1b-f50a-9333-3030-306982950658', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 13), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/3cf7af45-2bee-aa9c-d524-40b487149d60', 'Encounter/d2782687-6885-037c-957d-579fbd681d2a', 'DocumentReference/3f578a1b-f50a-9333-3030-306982950658') +('406679b2-a02c-0003-3b17-56ba373fccff', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/0734762a-9db6-22fc-b595-c3e472bb2a9a', 'Encounter/2f55edb9-a906-0b40-e183-89b1d65d1aa1', 'DocumentReference/406679b2-a02c-0003-3b17-56ba373fccff') +('406679b2-a02c-0003-3b17-56ba373fccff', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 21), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/0734762a-9db6-22fc-b595-c3e472bb2a9a', 'Encounter/2f55edb9-a906-0b40-e183-89b1d65d1aa1', 'DocumentReference/406679b2-a02c-0003-3b17-56ba373fccff') +('41eb62dd-7032-e98d-84c6-d494ad8c877b', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, 'final', None, datetime.date(2018, 7, 31), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/2a0e1946-acf6-5a7e-9399-a9cbc4730199', 'Encounter/aabb3ac3-c4a3-f613-9507-63280adb9209', 'DocumentReference/41eb62dd-7032-e98d-84c6-d494ad8c877b') +('41eb62dd-7032-e98d-84c6-d494ad8c877b', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, 'final', None, datetime.date(2018, 7, 31), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/2a0e1946-acf6-5a7e-9399-a9cbc4730199', 'Encounter/aabb3ac3-c4a3-f613-9507-63280adb9209', 'DocumentReference/41eb62dd-7032-e98d-84c6-d494ad8c877b') +('4390dbd1-3bdf-e516-9fe0-a8180181507f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, 'amended', None, datetime.date(2018, 6, 3), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/e80dda2c-a260-dbf7-3167-bf0945f3a91d', 'Encounter/029d1814-d7bf-0624-524d-7ccda5f320f6', 'DocumentReference/4390dbd1-3bdf-e516-9fe0-a8180181507f') +('4390dbd1-3bdf-e516-9fe0-a8180181507f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, 'amended', None, datetime.date(2018, 6, 3), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/e80dda2c-a260-dbf7-3167-bf0945f3a91d', 'Encounter/029d1814-d7bf-0624-524d-7ccda5f320f6', 'DocumentReference/4390dbd1-3bdf-e516-9fe0-a8180181507f') +('4390dbd1-3bdf-e516-9fe0-a8180181507f-error', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, 'entered-in-error', None, datetime.date(2018, 6, 3), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/e80dda2c-a260-dbf7-3167-bf0945f3a91d', 'Encounter/029d1814-d7bf-0624-524d-7ccda5f320f6', 'DocumentReference/4390dbd1-3bdf-e516-9fe0-a8180181507f-error') +('4390dbd1-3bdf-e516-9fe0-a8180181507f-error', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, 'entered-in-error', None, datetime.date(2018, 6, 3), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/e80dda2c-a260-dbf7-3167-bf0945f3a91d', 'Encounter/029d1814-d7bf-0624-524d-7ccda5f320f6', 'DocumentReference/4390dbd1-3bdf-e516-9fe0-a8180181507f-error') +('4439aa6e-fbc2-21a1-208e-095907104a65', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 30), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/82b8a670-4700-30e8-24a0-b83efa3c5e0a', 'Encounter/75b68644-535d-bdc1-4c31-aa9fe7e1822f', 'DocumentReference/4439aa6e-fbc2-21a1-208e-095907104a65') +('4439aa6e-fbc2-21a1-208e-095907104a65', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 30), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/82b8a670-4700-30e8-24a0-b83efa3c5e0a', 'Encounter/75b68644-535d-bdc1-4c31-aa9fe7e1822f', 'DocumentReference/4439aa6e-fbc2-21a1-208e-095907104a65') +('45160ef5-42e8-7239-6633-904308273198', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/3627adb8-f741-acf3-2dd6-10f3bcbe1077', 'Encounter/bca7cabc-b2fc-8a08-c69b-5bc0afa20d80', 'DocumentReference/45160ef5-42e8-7239-6633-904308273198') +('45160ef5-42e8-7239-6633-904308273198', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/3627adb8-f741-acf3-2dd6-10f3bcbe1077', 'Encounter/bca7cabc-b2fc-8a08-c69b-5bc0afa20d80', 'DocumentReference/45160ef5-42e8-7239-6633-904308273198') +('4711ca43-989d-a8f9-5f32-0102640804cf', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/d3c0274f-f42b-8d2b-15f2-82331e723383', 'Encounter/6565ef5c-30b9-8697-6ca6-2b77894d5437', 'DocumentReference/4711ca43-989d-a8f9-5f32-0102640804cf') +('4711ca43-989d-a8f9-5f32-0102640804cf', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/d3c0274f-f42b-8d2b-15f2-82331e723383', 'Encounter/6565ef5c-30b9-8697-6ca6-2b77894d5437', 'DocumentReference/4711ca43-989d-a8f9-5f32-0102640804cf') +('48693636-4eec-ad3d-b71d-8f650bd0a6f1', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/c7ad408d-fcae-b54a-eb1d-26d48f7a5f84', 'Encounter/02eb4e14-1a6f-d968-2c26-c0cf5023afe0', 'DocumentReference/48693636-4eec-ad3d-b71d-8f650bd0a6f1') +('48693636-4eec-ad3d-b71d-8f650bd0a6f1', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/c7ad408d-fcae-b54a-eb1d-26d48f7a5f84', 'Encounter/02eb4e14-1a6f-d968-2c26-c0cf5023afe0', 'DocumentReference/48693636-4eec-ad3d-b71d-8f650bd0a6f1') +('48933dd8-3fcf-416e-89ca-27851e45391f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 29), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/7cef0e6f-9aea-4079-dfc6-18a96454708e', 'Encounter/d735c414-9dd3-c9b1-285c-8da79a7fbbdf', 'DocumentReference/48933dd8-3fcf-416e-89ca-27851e45391f') +('48933dd8-3fcf-416e-89ca-27851e45391f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 29), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/7cef0e6f-9aea-4079-dfc6-18a96454708e', 'Encounter/d735c414-9dd3-c9b1-285c-8da79a7fbbdf', 'DocumentReference/48933dd8-3fcf-416e-89ca-27851e45391f') +('4b2e99d5-d4c2-fd1f-a5fd-96fe9546b58a', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/6385ddd7-2639-6505-3789-0521b8f66c8b', 'Encounter/fd0754a4-e96d-cba7-b3c0-77697a09c86e', 'DocumentReference/4b2e99d5-d4c2-fd1f-a5fd-96fe9546b58a') +('4b2e99d5-d4c2-fd1f-a5fd-96fe9546b58a', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/6385ddd7-2639-6505-3789-0521b8f66c8b', 'Encounter/fd0754a4-e96d-cba7-b3c0-77697a09c86e', 'DocumentReference/4b2e99d5-d4c2-fd1f-a5fd-96fe9546b58a') +('99b390f4-1bcb-21ec-85d5-85cbb74e86ae', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/9eaa056b-1efc-0cc8-70ff-62c8f704cc13', 'Encounter/5c994000-aa78-2be5-e6cf-99f230d50c2f', 'DocumentReference/99b390f4-1bcb-21ec-85d5-85cbb74e86ae') +('99b390f4-1bcb-21ec-85d5-85cbb74e86ae', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 13), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/9eaa056b-1efc-0cc8-70ff-62c8f704cc13', 'Encounter/5c994000-aa78-2be5-e6cf-99f230d50c2f', 'DocumentReference/99b390f4-1bcb-21ec-85d5-85cbb74e86ae') +('99d49a34-c515-23a1-c3e4-ef73c3cef727', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 26), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/cc9fb8e2-fe52-b72a-aebb-9d10260f121b', 'Encounter/683b04eb-663a-849f-715f-4ccd70bf1524', 'DocumentReference/99d49a34-c515-23a1-c3e4-ef73c3cef727') +('99d49a34-c515-23a1-c3e4-ef73c3cef727', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 26), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/cc9fb8e2-fe52-b72a-aebb-9d10260f121b', 'Encounter/683b04eb-663a-849f-715f-4ccd70bf1524', 'DocumentReference/99d49a34-c515-23a1-c3e4-ef73c3cef727') +('99e26f8b-a5a2-ad5e-713a-16266b5991a1', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/1c498b42-61fd-6341-69c3-053f6e4fe404', 'Encounter/e613f29d-7505-6f2e-a1f5-bfbec300752d', 'DocumentReference/99e26f8b-a5a2-ad5e-713a-16266b5991a1') +('99e26f8b-a5a2-ad5e-713a-16266b5991a1', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/1c498b42-61fd-6341-69c3-053f6e4fe404', 'Encounter/e613f29d-7505-6f2e-a1f5-bfbec300752d', 'DocumentReference/99e26f8b-a5a2-ad5e-713a-16266b5991a1') +('9a50a40a-8099-5ab5-0903-1ba65d8c0905', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/24906e2c-e556-71dc-23d9-3e1d5fb08986', 'Encounter/1154d05c-8727-9373-4224-25b9fdba9ab3', 'DocumentReference/9a50a40a-8099-5ab5-0903-1ba65d8c0905') +('9a50a40a-8099-5ab5-0903-1ba65d8c0905', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/24906e2c-e556-71dc-23d9-3e1d5fb08986', 'Encounter/1154d05c-8727-9373-4224-25b9fdba9ab3', 'DocumentReference/9a50a40a-8099-5ab5-0903-1ba65d8c0905') +('9ca118c6-e354-5588-3cdc-77ee3b3c8711', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/2da1bee2-2bc2-4511-84e1-42860310e2fb', 'Encounter/d5f342b7-017c-f2e7-8697-5a038c91518e', 'DocumentReference/9ca118c6-e354-5588-3cdc-77ee3b3c8711') +('9ca118c6-e354-5588-3cdc-77ee3b3c8711', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 28), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/2da1bee2-2bc2-4511-84e1-42860310e2fb', 'Encounter/d5f342b7-017c-f2e7-8697-5a038c91518e', 'DocumentReference/9ca118c6-e354-5588-3cdc-77ee3b3c8711') +('a1b69e45-11f8-a49f-170e-32004c70e842', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 11), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/5ce2e599-fb6e-9b4d-3c2e-87310619b957', 'Encounter/4b03a408-6694-88e3-0e63-3ee464ecd6cd', 'DocumentReference/a1b69e45-11f8-a49f-170e-32004c70e842') +('a1b69e45-11f8-a49f-170e-32004c70e842', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 11), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/5ce2e599-fb6e-9b4d-3c2e-87310619b957', 'Encounter/4b03a408-6694-88e3-0e63-3ee464ecd6cd', 'DocumentReference/a1b69e45-11f8-a49f-170e-32004c70e842') +('a3964c82-0605-c2b2-97dc-0de17a1ec0ef', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 17), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/7f941bcc-e7b2-99e1-585f-129d0ef1c13d', 'Encounter/65f8fdca-a949-80a0-8072-094e9aaee474', 'DocumentReference/a3964c82-0605-c2b2-97dc-0de17a1ec0ef') +('a3964c82-0605-c2b2-97dc-0de17a1ec0ef', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 17), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/7f941bcc-e7b2-99e1-585f-129d0ef1c13d', 'Encounter/65f8fdca-a949-80a0-8072-094e9aaee474', 'DocumentReference/a3964c82-0605-c2b2-97dc-0de17a1ec0ef') +('a5231f35-ad14-580e-1888-55c1b383aa11', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/3ae095ec-8fe0-133b-36d4-8785a6ad8df3', 'Encounter/75312bd2-d5ac-c62e-c9df-0004783725c7', 'DocumentReference/a5231f35-ad14-580e-1888-55c1b383aa11') +('a5231f35-ad14-580e-1888-55c1b383aa11', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/3ae095ec-8fe0-133b-36d4-8785a6ad8df3', 'Encounter/75312bd2-d5ac-c62e-c9df-0004783725c7', 'DocumentReference/a5231f35-ad14-580e-1888-55c1b383aa11') +('a59ca653-b95d-09d2-9fa5-a1b492d85a5f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 28), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/c20e5afd-30df-ac3d-6684-cc29438a9bc4', 'Encounter/b864bcd8-14e0-8bec-b7cc-f8629d91470e', 'DocumentReference/a59ca653-b95d-09d2-9fa5-a1b492d85a5f') +('a59ca653-b95d-09d2-9fa5-a1b492d85a5f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 28), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/c20e5afd-30df-ac3d-6684-cc29438a9bc4', 'Encounter/b864bcd8-14e0-8bec-b7cc-f8629d91470e', 'DocumentReference/a59ca653-b95d-09d2-9fa5-a1b492d85a5f') +('a69150c5-2fbe-2284-1eb5-e11146858a22', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 1), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/9c8d8539-0b1e-73e2-b64f-83f1ea601fa4', 'Encounter/f2752dd7-1bf1-739d-dd8c-40122d0b63bc', 'DocumentReference/a69150c5-2fbe-2284-1eb5-e11146858a22') +('a69150c5-2fbe-2284-1eb5-e11146858a22', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 1), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/9c8d8539-0b1e-73e2-b64f-83f1ea601fa4', 'Encounter/f2752dd7-1bf1-739d-dd8c-40122d0b63bc', 'DocumentReference/a69150c5-2fbe-2284-1eb5-e11146858a22') +('a7115116-f8da-3960-e3ed-f1f0d89646c3', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 2), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/8877ef1f-7cd7-3242-d7f0-73cf3f7165f4', 'Encounter/299b6495-3fe7-8db3-c494-6e1ce8b7986d', 'DocumentReference/a7115116-f8da-3960-e3ed-f1f0d89646c3') +('a7115116-f8da-3960-e3ed-f1f0d89646c3', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 2), datetime.date(2018, 5, 28), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/8877ef1f-7cd7-3242-d7f0-73cf3f7165f4', 'Encounter/299b6495-3fe7-8db3-c494-6e1ce8b7986d', 'DocumentReference/a7115116-f8da-3960-e3ed-f1f0d89646c3') +('a79da4dd-83bc-5b6a-db34-bd35b3acbd2c', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 6), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/19158de4-66a2-f70f-e3bf-4396b312c8f1', 'Encounter/ed151e04-3dd6-8cb7-a3e5-777c8a8667f1', 'DocumentReference/a79da4dd-83bc-5b6a-db34-bd35b3acbd2c') +('a79da4dd-83bc-5b6a-db34-bd35b3acbd2c', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 6), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/19158de4-66a2-f70f-e3bf-4396b312c8f1', 'Encounter/ed151e04-3dd6-8cb7-a3e5-777c8a8667f1', 'DocumentReference/a79da4dd-83bc-5b6a-db34-bd35b3acbd2c') +('a95df5ea-7005-9e98-e97a-1ade6967b585', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 16), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/16be855b-ece2-8b96-1ef9-a4d93adf3289', 'Encounter/83d0d564-3bbf-48eb-7445-bd2b81130671', 'DocumentReference/a95df5ea-7005-9e98-e97a-1ade6967b585') +('a95df5ea-7005-9e98-e97a-1ade6967b585', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 16), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/16be855b-ece2-8b96-1ef9-a4d93adf3289', 'Encounter/83d0d564-3bbf-48eb-7445-bd2b81130671', 'DocumentReference/a95df5ea-7005-9e98-e97a-1ade6967b585') +('a96ba3b7-a461-5849-1881-d372e0460ccc', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 14), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/26a3984f-b2a8-e67f-7abc-ff147a0e6e35', 'Encounter/79d8f213-7847-646b-8a66-5da208cc1c27', 'DocumentReference/a96ba3b7-a461-5849-1881-d372e0460ccc') +('a96ba3b7-a461-5849-1881-d372e0460ccc', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 14), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/26a3984f-b2a8-e67f-7abc-ff147a0e6e35', 'Encounter/79d8f213-7847-646b-8a66-5da208cc1c27', 'DocumentReference/a96ba3b7-a461-5849-1881-d372e0460ccc') +('ac0439bc-e450-d339-da6d-5ead96d8b346', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 30), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/2858705f-5af1-9869-4d94-894e09a9f99a', 'Encounter/de9d67de-6ae3-32f7-20f2-e719ae23a9a3', 'DocumentReference/ac0439bc-e450-d339-da6d-5ead96d8b346') +('ac0439bc-e450-d339-da6d-5ead96d8b346', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 30), datetime.date(2018, 7, 30), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/2858705f-5af1-9869-4d94-894e09a9f99a', 'Encounter/de9d67de-6ae3-32f7-20f2-e719ae23a9a3', 'DocumentReference/ac0439bc-e450-d339-da6d-5ead96d8b346') +('ad2bee76-6e59-5d8b-21ed-b30cdb784198', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 9), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/e455ca3f-fc16-6ffc-297a-adc27e2db183', 'Encounter/98d4bd14-d78e-debb-e7dc-2df7786aedf3', 'DocumentReference/ad2bee76-6e59-5d8b-21ed-b30cdb784198') +('ad2bee76-6e59-5d8b-21ed-b30cdb784198', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 9), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/e455ca3f-fc16-6ffc-297a-adc27e2db183', 'Encounter/98d4bd14-d78e-debb-e7dc-2df7786aedf3', 'DocumentReference/ad2bee76-6e59-5d8b-21ed-b30cdb784198') +('b1f5c114-8e28-08c0-0193-0855aa10c97f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/c7c5c028-f1fb-962b-8db2-dfd4c6d6b02a', 'Encounter/aa890974-162f-5906-dc71-2bb6d2185314', 'DocumentReference/b1f5c114-8e28-08c0-0193-0855aa10c97f') +('b1f5c114-8e28-08c0-0193-0855aa10c97f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/c7c5c028-f1fb-962b-8db2-dfd4c6d6b02a', 'Encounter/aa890974-162f-5906-dc71-2bb6d2185314', 'DocumentReference/b1f5c114-8e28-08c0-0193-0855aa10c97f') +('b2896621-57ef-1ad3-91c5-389dce96973b', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 7), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/ac91b90d-97e4-4fc5-41cd-036bac49e6e8', 'Encounter/dc5ed645-3979-e765-3e03-6ba2173027c3', 'DocumentReference/b2896621-57ef-1ad3-91c5-389dce96973b') +('b2896621-57ef-1ad3-91c5-389dce96973b', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 7), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/ac91b90d-97e4-4fc5-41cd-036bac49e6e8', 'Encounter/dc5ed645-3979-e765-3e03-6ba2173027c3', 'DocumentReference/b2896621-57ef-1ad3-91c5-389dce96973b') +('b3357397-9f4c-7d00-06af-18f03c63d583', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/c1bfec36-dc2c-afc8-c767-3d35ed2bf6f0', 'Encounter/8ff1dc01-5a28-b2d8-3b42-4b7a7d539970', 'DocumentReference/b3357397-9f4c-7d00-06af-18f03c63d583') +('b3357397-9f4c-7d00-06af-18f03c63d583', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/c1bfec36-dc2c-afc8-c767-3d35ed2bf6f0', 'Encounter/8ff1dc01-5a28-b2d8-3b42-4b7a7d539970', 'DocumentReference/b3357397-9f4c-7d00-06af-18f03c63d583') +('b339c2e8-35eb-1838-7eea-5a04c81695df', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/267fc42d-cd9e-8527-1f9e-887fe7776147', 'Encounter/4c4d0730-201f-5b75-c657-8d0de09cc28f', 'DocumentReference/b339c2e8-35eb-1838-7eea-5a04c81695df') +('b339c2e8-35eb-1838-7eea-5a04c81695df', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 14), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/267fc42d-cd9e-8527-1f9e-887fe7776147', 'Encounter/4c4d0730-201f-5b75-c657-8d0de09cc28f', 'DocumentReference/b339c2e8-35eb-1838-7eea-5a04c81695df') +('b39532e8-ee15-a7c4-cac5-353a8be67d15', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 8), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/6a883108-7b87-120b-d163-d369336e04e5', 'Encounter/2b1ee164-6c87-420d-a9e2-6c235ebeef71', 'DocumentReference/b39532e8-ee15-a7c4-cac5-353a8be67d15') +('b39532e8-ee15-a7c4-cac5-353a8be67d15', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 8), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/6a883108-7b87-120b-d163-d369336e04e5', 'Encounter/2b1ee164-6c87-420d-a9e2-6c235ebeef71', 'DocumentReference/b39532e8-ee15-a7c4-cac5-353a8be67d15') +('b44d277c-7c09-a39b-97e9-1e96d71b6978', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/7bf52d54-0d2a-265a-15aa-eeed7aaf4af6', 'Encounter/ba84689e-2f9f-7cea-af1f-d69ffdd3a3eb', 'DocumentReference/b44d277c-7c09-a39b-97e9-1e96d71b6978') +('b44d277c-7c09-a39b-97e9-1e96d71b6978', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/7bf52d54-0d2a-265a-15aa-eeed7aaf4af6', 'Encounter/ba84689e-2f9f-7cea-af1f-d69ffdd3a3eb', 'DocumentReference/b44d277c-7c09-a39b-97e9-1e96d71b6978') +('b58f7768-64be-6c0f-1b82-3deffdef1076', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/a28be3e1-a6bd-7df4-fc81-1140848f8453', 'Encounter/91f94a9d-69a7-e30a-cd1a-68c52dc01e70', 'DocumentReference/b58f7768-64be-6c0f-1b82-3deffdef1076') +('b58f7768-64be-6c0f-1b82-3deffdef1076', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 29), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/a28be3e1-a6bd-7df4-fc81-1140848f8453', 'Encounter/91f94a9d-69a7-e30a-cd1a-68c52dc01e70', 'DocumentReference/b58f7768-64be-6c0f-1b82-3deffdef1076') +('b73493d0-e2f4-9aa6-cdad-920f7c126d6c', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 16), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/50f8b42e-17a6-e932-8546-da94004c597c', 'Encounter/37604257-be1a-120f-81ee-336f81603f92', 'DocumentReference/b73493d0-e2f4-9aa6-cdad-920f7c126d6c') +('b73493d0-e2f4-9aa6-cdad-920f7c126d6c', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 16), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/50f8b42e-17a6-e932-8546-da94004c597c', 'Encounter/37604257-be1a-120f-81ee-336f81603f92', 'DocumentReference/b73493d0-e2f4-9aa6-cdad-920f7c126d6c') +('b7b68006-53d5-b823-d193-56b262f45e8b', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/ad3ed58a-5645-af0a-eeca-ab543123a8aa', 'Encounter/03e34b19-2889-b828-792d-2a83400c55be', 'DocumentReference/b7b68006-53d5-b823-d193-56b262f45e8b') +('b7b68006-53d5-b823-d193-56b262f45e8b', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 19), datetime.date(2018, 7, 16), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/ad3ed58a-5645-af0a-eeca-ab543123a8aa', 'Encounter/03e34b19-2889-b828-792d-2a83400c55be', 'DocumentReference/b7b68006-53d5-b823-d193-56b262f45e8b') +('b953a85f-f18b-d7a3-8974-ba44e0a3141c', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 5), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/a5bc08ea-9462-c4f5-1bd2-ff342598ac99', 'Encounter/f964be66-3fcd-95c8-0021-71c7d24c91b7', 'DocumentReference/b953a85f-f18b-d7a3-8974-ba44e0a3141c') +('b953a85f-f18b-d7a3-8974-ba44e0a3141c', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 5), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/a5bc08ea-9462-c4f5-1bd2-ff342598ac99', 'Encounter/f964be66-3fcd-95c8-0021-71c7d24c91b7', 'DocumentReference/b953a85f-f18b-d7a3-8974-ba44e0a3141c') +('b985a70c-9504-b7b3-0707-f8381ba77976', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/149de67a-2809-59a8-bfa2-36df509021dc', 'Encounter/beb26500-4ccd-ce0a-44f6-74f44be5fafe', 'DocumentReference/b985a70c-9504-b7b3-0707-f8381ba77976') +('b985a70c-9504-b7b3-0707-f8381ba77976', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 7), datetime.date(2018, 6, 4), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/149de67a-2809-59a8-bfa2-36df509021dc', 'Encounter/beb26500-4ccd-ce0a-44f6-74f44be5fafe', 'DocumentReference/b985a70c-9504-b7b3-0707-f8381ba77976') +('ba0abbd6-49a9-95fa-2396-7118c56da8c6', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 12), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/9b17654f-a902-3d56-9000-4ade3dd3059f', 'Encounter/ca45bbef-ef2a-3b3c-ea5e-76bcd5865780', 'DocumentReference/ba0abbd6-49a9-95fa-2396-7118c56da8c6') +('ba0abbd6-49a9-95fa-2396-7118c56da8c6', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 12), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/9b17654f-a902-3d56-9000-4ade3dd3059f', 'Encounter/ca45bbef-ef2a-3b3c-ea5e-76bcd5865780', 'DocumentReference/ba0abbd6-49a9-95fa-2396-7118c56da8c6') +('bcbaa9d3-d7cf-3f5f-44d3-32c8a267f991', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/17fde357-dcc9-af8b-a8d3-4bd213afeb22', 'Encounter/32d0ae2d-1be8-9e90-a4da-4c222abd88a9', 'DocumentReference/bcbaa9d3-d7cf-3f5f-44d3-32c8a267f991') +('bcbaa9d3-d7cf-3f5f-44d3-32c8a267f991', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/17fde357-dcc9-af8b-a8d3-4bd213afeb22', 'Encounter/32d0ae2d-1be8-9e90-a4da-4c222abd88a9', 'DocumentReference/bcbaa9d3-d7cf-3f5f-44d3-32c8a267f991') +('bd60a52b-65b9-f26d-03e4-282850509f03', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/51032f44-d514-26e9-3e85-e956561c076e', 'Encounter/d73ed087-e0ae-78e0-7a05-1bac1060c476', 'DocumentReference/bd60a52b-65b9-f26d-03e4-282850509f03') +('bd60a52b-65b9-f26d-03e4-282850509f03', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 10), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/51032f44-d514-26e9-3e85-e956561c076e', 'Encounter/d73ed087-e0ae-78e0-7a05-1bac1060c476', 'DocumentReference/bd60a52b-65b9-f26d-03e4-282850509f03') +('bfddb0ff-1296-107e-76ca-14b4a14db9ce', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/26baae20-c8c5-003a-ab6b-ebcc49be20db', 'Encounter/c6ec2350-43d4-abab-2e84-4d2aadb337a7', 'DocumentReference/bfddb0ff-1296-107e-76ca-14b4a14db9ce') +('bfddb0ff-1296-107e-76ca-14b4a14db9ce', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 2), datetime.date(2018, 7, 2), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/26baae20-c8c5-003a-ab6b-ebcc49be20db', 'Encounter/c6ec2350-43d4-abab-2e84-4d2aadb337a7', 'DocumentReference/bfddb0ff-1296-107e-76ca-14b4a14db9ce') +('c18dbe84-be31-cee5-1f2e-cf163cdd3e3f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 27), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/a5b171a7-9b28-20e7-86a7-936ecbf55f36', 'Encounter/c4605953-3103-ede6-e0c0-e0588e6f019e', 'DocumentReference/c18dbe84-be31-cee5-1f2e-cf163cdd3e3f') +('c18dbe84-be31-cee5-1f2e-cf163cdd3e3f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 27), datetime.date(2018, 7, 23), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/a5b171a7-9b28-20e7-86a7-936ecbf55f36', 'Encounter/c4605953-3103-ede6-e0c0-e0588e6f019e', 'DocumentReference/c18dbe84-be31-cee5-1f2e-cf163cdd3e3f') +('c6598486-8276-b44a-286e-b376143f7efc', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 25), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/47c37c92-5932-9cfe-66be-208556780fe0', 'Encounter/b5974881-ae62-ddd6-b905-8c86c1ca9e33', 'DocumentReference/c6598486-8276-b44a-286e-b376143f7efc') +('c6598486-8276-b44a-286e-b376143f7efc', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 25), datetime.date(2018, 6, 25), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/47c37c92-5932-9cfe-66be-208556780fe0', 'Encounter/b5974881-ae62-ddd6-b905-8c86c1ca9e33', 'DocumentReference/c6598486-8276-b44a-286e-b376143f7efc') +('c6c64129-9dfa-840d-3309-a5590cc74f2e', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/ad239efc-637c-e428-c829-b87e700d5446', 'Encounter/366df7d3-2ea9-db22-7cdd-60fa8a5c45ca', 'DocumentReference/c6c64129-9dfa-840d-3309-a5590cc74f2e') +('c6c64129-9dfa-840d-3309-a5590cc74f2e', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 6, 15), datetime.date(2018, 6, 11), datetime.date(2018, 6, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/ad239efc-637c-e428-c829-b87e700d5446', 'Encounter/366df7d3-2ea9-db22-7cdd-60fa8a5c45ca', 'DocumentReference/c6c64129-9dfa-840d-3309-a5590cc74f2e') +('c84e67e9-4ea8-700b-9f2b-c0179e803d4f', 'current', '34111-5', 'http://loinc.org', 'Emergency department note', None, None, None, datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/dffa62dc-8ec2-1cd6-ee75-f9156a5283fe', 'Encounter/11381dc6-0e06-da55-0735-d1e7bbf8bb35', 'DocumentReference/c84e67e9-4ea8-700b-9f2b-c0179e803d4f') +('c84e67e9-4ea8-700b-9f2b-c0179e803d4f', 'current', '51847-2', 'http://loinc.org', 'Evaluation + Plan note', None, None, None, datetime.date(2018, 7, 15), datetime.date(2018, 7, 9), datetime.date(2018, 7, 1), datetime.date(2018, 1, 1), 'urn:ihe:iti:xds:2017:mimeTypeSufficient', 'Patient/dffa62dc-8ec2-1cd6-ee75-f9156a5283fe', 'Encounter/11381dc6-0e06-da55-0735-d1e7bbf8bb35', 'DocumentReference/c84e67e9-4ea8-700b-9f2b-c0179e803d4f') diff --git a/tests/test_templates.py b/tests/test_templates.py index 50ca5975..e1f2e0fb 100644 --- a/tests/test_templates.py +++ b/tests/test_templates.py @@ -59,8 +59,6 @@ def test_codeable_concept_denormalize_all_creation(): target_table="target__concepts", ) query = base_templates.get_codeable_concept_denormalize_query(config) - with open("output.sql", "w") as f: - f.write(query) assert query == expected From dcd9de140bbb93a29bfc9db701c37fdc162dc32e Mon Sep 17 00:00:00 2001 From: Matt Garber Date: Thu, 21 Mar 2024 14:32:11 -0400 Subject: [PATCH 7/8] much ado about names --- cumulus_library/template_sql/sql_utils.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cumulus_library/template_sql/sql_utils.py b/cumulus_library/template_sql/sql_utils.py index a11b8e93..a6c11a29 100644 --- a/cumulus_library/template_sql/sql_utils.py +++ b/cumulus_library/template_sql/sql_utils.py @@ -22,8 +22,8 @@ @dataclass(kw_only=True) -class FhirObjectDNConfig(abc.ABC): - """ABC for handling table detection/denormalization of objects in SQL""" +class BaseConfig(abc.ABC): + """Abstract ase class for handling table detection/denormalization""" source_table: str = None source_id: str = "id" @@ -32,7 +32,7 @@ class FhirObjectDNConfig(abc.ABC): @dataclass(kw_only=True) -class CodeableConceptConfig(FhirObjectDNConfig): +class CodeableConceptConfig(BaseConfig): """Holds parameters for generating codableconcept tables. :param column_name: the column containing the codeableConcept you want to extract. @@ -54,7 +54,7 @@ class CodeableConceptConfig(FhirObjectDNConfig): @dataclass(kw_only=True) -class CodingConfig(FhirObjectDNConfig): +class CodingConfig(BaseConfig): column_hierarchy: list[tuple] filter_priority: bool = False code_systems: list = None @@ -62,7 +62,7 @@ class CodingConfig(FhirObjectDNConfig): @dataclass(kw_only=True) -class ExtensionConfig(FhirObjectDNConfig): +class ExtensionConfig(BaseConfig): """convenience class for holding parameters for generating extension tables. :param source_table: the table to extract extensions from @@ -126,7 +126,7 @@ def _check_data_in_fields( def denormalize_complex_objects( schema: str, cursor: databases.DatabaseCursor, - code_sources: list[FhirObjectDNConfig], + code_sources: list[BaseConfig], ): queries = [] code_sources = _check_data_in_fields(schema, cursor, code_sources) From 9b71dad7a92dad0a4072d5949330aa2a47dd54f4 Mon Sep 17 00:00:00 2001 From: Matt Garber Date: Fri, 22 Mar 2024 09:01:48 -0400 Subject: [PATCH 8/8] tweaks to nested field handling --- cumulus_library/template_sql/sql_utils.py | 56 ++++++++++++----------- 1 file changed, 30 insertions(+), 26 deletions(-) diff --git a/cumulus_library/template_sql/sql_utils.py b/cumulus_library/template_sql/sql_utils.py index a6c11a29..48ba71fb 100644 --- a/cumulus_library/template_sql/sql_utils.py +++ b/cumulus_library/template_sql/sql_utils.py @@ -35,14 +35,14 @@ class BaseConfig(abc.ABC): class CodeableConceptConfig(BaseConfig): """Holds parameters for generating codableconcept tables. - :param column_name: the column containing the codeableConcept you want to extract. - :param is_array: whether the codeableConcept is 0...1 or 0..* in the FHIR spec - :param source_table: the table to extract extensions from - :param target_table: the name of the table to create - :param source_id: the id field to use in the new table (default: 'id') - :param filter_priority: If true, will use code systems to select a single code, + :keyword column_name: the column containing the codeableConcept you want to extract. + :keyword is_array: whether the codeableConcept is 0...1 or 0..* in the FHIR spec + :keyword source_table: the table to extract extensions from + :keyword target_table: the name of the table to create + :keyword source_id: the id field to use in the new table (default: 'id') + :keyword filter_priority: If true, will use code systems to select a single code, in preference order, for use as a display value. - :param code_systems: a list of strings matching the start of the systems field, + :keyword code_systems: a list of strings matching the start of the systems field, in preference order, for selecting data for filtering. This should not be set if filter_priority is false. """ @@ -65,13 +65,13 @@ class CodingConfig(BaseConfig): class ExtensionConfig(BaseConfig): """convenience class for holding parameters for generating extension tables. - :param source_table: the table to extract extensions from - :param source_id: the id column to treat as a foreign key - :param target_table: the name of the table to create - :param target_col_prefix: the string to prepend code/display column names with - :param fhir_extension: the URL of the FHIR resource to select - :param ext_systems: a list of codes, in preference order, to use to select data - :param is_array: a boolean indicating if the targeted field is an array type + :keyword source_table: the table to extract extensions from + :keyword source_id: the id column to treat as a foreign key + :keyword target_table: the name of the table to create + :keyword target_col_prefix: the string to prepend code/display column names with + :keyword fhir_extension: the URL of the FHIR resource to select + :keyword ext_systems: a list of codes, in preference order, to use to select data + :keyword is_array: a boolean indicating if the targeted field is an array type """ target_col_prefix: str @@ -178,13 +178,13 @@ def is_field_populated( ) -> bool: """Traverses a complex field and determines if it exists and has data - :param schema: The schema/database name - :param cursor: a PEP-249 compliant database cursor - :param source_table: The table to query against - :param hierarchy: a list of tuples defining the FHIR path to the element. + :keyword schema: The schema/database name + :keyword cursor: a PEP-249 compliant database cursor + :keyword source_table: The table to query against + :keyword hierarchy: a list of tuples defining the FHIR path to the element. Each tuple should be of the form ('element_name', dict | list), where a dict is a bare nested object and a list is an array object - :param expected: a list of elements that should be present in the field. + :keyword expected: a list of elements that should be present in the field. If none, we assume it is a CodeableConcept. :returns: a boolean indicating if valid data is present. """ @@ -193,8 +193,8 @@ def is_field_populated( cursor=cursor, source_table=source_table, source_col=hierarchy[0][0], - target_field=hierarchy[-1][0], expected=expected, + nested_field=hierarchy[-1][0] if len(hierarchy) > 1 else None, ): return False unnests = [] @@ -230,19 +230,21 @@ def is_field_populated( def _check_schema_if_exists( + *, schema: str, cursor: databases.DatabaseCursor, source_table: str, source_col: str, - expected=None, + expected: str | None = None, + nested_field: str | None = None, ) -> bool: """Validation check for a column existing, and having the expected schema - :param schema: The schema/database name - :param cursor: a PEP-249 compliant database cursor - :param source_table: The table to query against - :param source_col: The column to check the schema against - :param expected: a list of elements that should be present in source_col. + :keyword schema: The schema/database name + :keyword cursor: a PEP-249 compliant database cursor + :keyword source_table: The table to query against + :keyword source_col: The column to check the schema against + :keyword expected: a list of elements that should be present in source_col. If none, we assume it is a CodeableConcept. :returns: a boolean indicating if the schema was found. """ @@ -264,6 +266,8 @@ def _check_schema_if_exists( # - containing the expected elements # but it does not check the elements are actually associated with that field. # This should be revisited once we've got better database parsing logic in place + if nested_field: + expected = [nested_field, *expected] if any(x not in schema_str.lower() for x in expected): return False return True