From 60784cb843a78639fa67f38bd01418ff78c5c68c Mon Sep 17 00:00:00 2001 From: Emmanuel Nyachoke Date: Tue, 18 Jun 2024 17:35:24 +0300 Subject: [PATCH] KH-539: Add default Superset datasets (#73) --- .../superset/assets/databases/Analytics.yaml | 16 + .../datasets/Analytics/appointments.yaml | 485 ++++++++++++++++ .../assets/datasets/Analytics/concepts.yaml | 137 +++++ .../assets/datasets/Analytics/conditions.yaml | 257 +++++++++ .../Analytics/encounter_diagnoses.yaml | 197 +++++++ .../assets/datasets/Analytics/encounters.yaml | 233 ++++++++ .../assets/datasets/Analytics/locations.yaml | 461 ++++++++++++++++ .../datasets/Analytics/observations.yaml | 413 ++++++++++++++ .../assets/datasets/Analytics/orders.yaml | 521 ++++++++++++++++++ .../datasets/Analytics/patient_programs.yaml | 341 ++++++++++++ .../assets/datasets/Analytics/patients.yaml | 485 ++++++++++++++++ .../datasets/Analytics/sale_order_lines.yaml | 245 ++++++++ .../assets/datasets/Analytics/visits.yaml | 257 +++++++++ distro/configs/superset/assets/metadata.yaml | 3 + distro/configs/superset/client_secret.json | 14 + distro/configs/superset/security.py | 58 ++ distro/configs/superset/superset-init.sh | 13 +- distro/configs/superset/superset_config.py | 40 +- .../.mvn/wrapper/maven-wrapper.properties | 2 +- 19 files changed, 4154 insertions(+), 24 deletions(-) create mode 100644 distro/configs/superset/assets/databases/Analytics.yaml create mode 100644 distro/configs/superset/assets/datasets/Analytics/appointments.yaml create mode 100644 distro/configs/superset/assets/datasets/Analytics/concepts.yaml create mode 100644 distro/configs/superset/assets/datasets/Analytics/conditions.yaml create mode 100644 distro/configs/superset/assets/datasets/Analytics/encounter_diagnoses.yaml create mode 100644 distro/configs/superset/assets/datasets/Analytics/encounters.yaml create mode 100644 distro/configs/superset/assets/datasets/Analytics/locations.yaml create mode 100644 distro/configs/superset/assets/datasets/Analytics/observations.yaml create mode 100644 distro/configs/superset/assets/datasets/Analytics/orders.yaml create mode 100644 distro/configs/superset/assets/datasets/Analytics/patient_programs.yaml create mode 100644 distro/configs/superset/assets/datasets/Analytics/patients.yaml create mode 100644 distro/configs/superset/assets/datasets/Analytics/sale_order_lines.yaml create mode 100644 distro/configs/superset/assets/datasets/Analytics/visits.yaml create mode 100644 distro/configs/superset/assets/metadata.yaml create mode 100644 distro/configs/superset/client_secret.json create mode 100644 distro/configs/superset/security.py diff --git a/distro/configs/superset/assets/databases/Analytics.yaml b/distro/configs/superset/assets/databases/Analytics.yaml new file mode 100644 index 0000000..b5b14c5 --- /dev/null +++ b/distro/configs/superset/assets/databases/Analytics.yaml @@ -0,0 +1,16 @@ +database_name: Analytics +sqlalchemy_uri: postgresql://analytics:{ANALYTICS_DB_PASSWORD}@postgresql:5432/analytics +cache_timeout: null +expose_in_sqllab: true +allow_run_async: false +allow_ctas: true +allow_cvas: true +allow_dml: false +allow_file_upload: true +extra: + metadata_params: {} + engine_params: {} + metadata_cache_timeout: {} + schemas_allowed_for_file_upload: [] +uuid: 4e5f4045-a62d-4964-b719-58229a60e7fe +version: 1.0.0 diff --git a/distro/configs/superset/assets/datasets/Analytics/appointments.yaml b/distro/configs/superset/assets/datasets/Analytics/appointments.yaml new file mode 100644 index 0000000..6337ef0 --- /dev/null +++ b/distro/configs/superset/assets/datasets/Analytics/appointments.yaml @@ -0,0 +1,485 @@ +table_name: appointments +main_dttm_col: start_date_time +description: null +default_endpoint: null +offset: 0 +cache_timeout: null +schema: public +sql: 'SELECT * FROM appointments ' +params: null +template_params: null +filter_select_enabled: true +fetch_values_predicate: null +extra: null +normalize_columns: false +always_filter_main_dttm: false +uuid: b9c2b2f1-8c03-44a8-a418-562534409189 +metrics: +- metric_name: count + verbose_name: COUNT(*) + metric_type: count + expression: COUNT(*) + description: null + d3format: null + currency: null + extra: null + warning_text: null +columns: +- column_name: appointment_service_type_voided + verbose_name: null + is_dttm: false + is_active: true + type: BOOLEAN + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: appointment_service_voided + verbose_name: null + is_dttm: false + is_active: true + type: BOOLEAN + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: voided + verbose_name: null + is_dttm: false + is_active: true + type: BOOLEAN + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: appointment_service_start_time + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: appointment_service_end_time + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: start_date_time + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: end_date_time + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: date_created + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: date_changed + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: date_voided + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: appointment_service_max_appointments_limit + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: appointment_service_type_duration_mins + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: appointment_service_speciality_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: appointment_service_duration_mins + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: appointment_service_type_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: related_appointment_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: patient_appointment_provider + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: patient_appointment_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: appointment_service_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: changed_by + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: location_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: patient_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: voided_by + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: creator + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: appointment_service_initial_appointment_status + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: appointment_service_type_name + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: patient_appointment_provider_response + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: appointment_service_type_uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: appointment_service_name + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: appointment_service_description + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: appointment_service_color + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: appointment_service_uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: appointment_number + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: appointment_kind + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: void_reason + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: status + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: comments + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +version: 1.0.0 +database_uuid: 4e5f4045-a62d-4964-b719-58229a60e7fe diff --git a/distro/configs/superset/assets/datasets/Analytics/concepts.yaml b/distro/configs/superset/assets/datasets/Analytics/concepts.yaml new file mode 100644 index 0000000..f6342b2 --- /dev/null +++ b/distro/configs/superset/assets/datasets/Analytics/concepts.yaml @@ -0,0 +1,137 @@ +table_name: concepts +main_dttm_col: null +description: null +default_endpoint: null +offset: 0 +cache_timeout: null +schema: public +sql: 'SELECT * FROM concepts' +params: null +template_params: null +filter_select_enabled: true +fetch_values_predicate: null +extra: null +normalize_columns: false +always_filter_main_dttm: false +uuid: 1c653214-9016-47db-8e78-6e2515b15fd9 +metrics: +- metric_name: count + verbose_name: COUNT(*) + metric_type: count + expression: COUNT(*) + description: null + d3format: null + currency: null + extra: null + warning_text: null +columns: +- column_name: locale_preferred + verbose_name: null + is_dttm: false + is_active: true + type: BOOLEAN + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: retired + verbose_name: null + is_dttm: false + is_active: true + type: BOOLEAN + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: concept_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: concept_mappings_source_codes + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: answer_concepts_uuids + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: member_concepts_uuids + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: locale + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: name + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +version: 1.0.0 +database_uuid: 4e5f4045-a62d-4964-b719-58229a60e7fe diff --git a/distro/configs/superset/assets/datasets/Analytics/conditions.yaml b/distro/configs/superset/assets/datasets/Analytics/conditions.yaml new file mode 100644 index 0000000..4e7779d --- /dev/null +++ b/distro/configs/superset/assets/datasets/Analytics/conditions.yaml @@ -0,0 +1,257 @@ +table_name: conditions +main_dttm_col: onset_date +description: null +default_endpoint: null +offset: 0 +cache_timeout: null +schema: public +sql: 'SELECT * FROM conditions ' +params: null +template_params: null +filter_select_enabled: true +fetch_values_predicate: null +extra: null +normalize_columns: false +always_filter_main_dttm: false +uuid: 743f9340-37e5-46e2-970b-437afbbce253 +metrics: +- metric_name: count + verbose_name: COUNT(*) + metric_type: count + expression: COUNT(*) + description: null + d3format: null + currency: null + extra: null + warning_text: null +columns: +- column_name: voided + verbose_name: null + is_dttm: false + is_active: true + type: BOOLEAN + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: date_created + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: date_voided + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: end_date + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: onset_date + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: condition_coded_name + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: changed_by + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: patient_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: voided_by + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: condition_coded + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: condition_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: previous_version + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: creator + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: condition_non_coded + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: additional_detail + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: clinical_status + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: verification_status + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: void_reason + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +version: 1.0.0 +database_uuid: 4e5f4045-a62d-4964-b719-58229a60e7fe diff --git a/distro/configs/superset/assets/datasets/Analytics/encounter_diagnoses.yaml b/distro/configs/superset/assets/datasets/Analytics/encounter_diagnoses.yaml new file mode 100644 index 0000000..ddcb5bc --- /dev/null +++ b/distro/configs/superset/assets/datasets/Analytics/encounter_diagnoses.yaml @@ -0,0 +1,197 @@ +table_name: encounter_diagnoses +main_dttm_col: date_created +description: null +default_endpoint: null +offset: 0 +cache_timeout: null +schema: public +sql: 'SELECT * FROM encounter_diagnoses ' +params: null +template_params: null +filter_select_enabled: true +fetch_values_predicate: null +extra: null +normalize_columns: false +always_filter_main_dttm: false +uuid: d1a53dfb-d354-455b-b165-731bd595e727 +metrics: +- metric_name: count + verbose_name: COUNT(*) + metric_type: count + expression: COUNT(*) + description: null + d3format: null + currency: null + extra: null + warning_text: null +columns: +- column_name: voided + verbose_name: null + is_dttm: false + is_active: true + type: BOOLEAN + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: date_created + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: date_voided + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: diagnosis_coded_name + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: diagnosis_coded + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: diagnosis_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: patient_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: voided_by + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: encounter_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: creator + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: diagnosis_non_coded + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: void_reason + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: certainty + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +version: 1.0.0 +database_uuid: 4e5f4045-a62d-4964-b719-58229a60e7fe diff --git a/distro/configs/superset/assets/datasets/Analytics/encounters.yaml b/distro/configs/superset/assets/datasets/Analytics/encounters.yaml new file mode 100644 index 0000000..b3efd9f --- /dev/null +++ b/distro/configs/superset/assets/datasets/Analytics/encounters.yaml @@ -0,0 +1,233 @@ +table_name: encounters +main_dttm_col: encounter_datetime +description: null +default_endpoint: null +offset: 0 +cache_timeout: null +schema: public +sql: 'SELECT * FROM encounters ' +params: null +template_params: null +filter_select_enabled: true +fetch_values_predicate: null +extra: null +normalize_columns: false +always_filter_main_dttm: false +uuid: 8cb187f9-4ea2-45da-9c88-575daff6e5d8 +metrics: +- metric_name: count + verbose_name: COUNT(*) + metric_type: count + expression: COUNT(*) + description: null + d3format: null + currency: null + extra: null + warning_text: null +columns: +- column_name: encounter_voided + verbose_name: null + is_dttm: false + is_active: true + type: BOOLEAN + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: visit_date_started + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: visit_date_stopped + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: encounter_datetime + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: encounter_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: encounter_type_uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: creator_uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: location_uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: patient_uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: form_name + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: encounter_uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: encounter_type + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: form_uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: visit_uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: form_version + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: visit_type + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: location + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +version: 1.0.0 +database_uuid: 4e5f4045-a62d-4964-b719-58229a60e7fe diff --git a/distro/configs/superset/assets/datasets/Analytics/locations.yaml b/distro/configs/superset/assets/datasets/Analytics/locations.yaml new file mode 100644 index 0000000..d819ca6 --- /dev/null +++ b/distro/configs/superset/assets/datasets/Analytics/locations.yaml @@ -0,0 +1,461 @@ +table_name: locations +main_dttm_col: date_created +description: null +default_endpoint: null +offset: 0 +cache_timeout: null +schema: public +sql: 'SELECT * FROM locations ' +params: null +template_params: null +filter_select_enabled: true +fetch_values_predicate: null +extra: null +normalize_columns: false +always_filter_main_dttm: false +uuid: e38d61fa-152e-484c-bd04-3c9fa26159de +metrics: +- metric_name: count + verbose_name: COUNT(*) + metric_type: count + expression: COUNT(*) + description: null + d3format: null + currency: null + extra: null + warning_text: null +columns: +- column_name: address10 + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address11 + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address12 + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address13 + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address14 + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address15 + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address1 + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address2 + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address3 + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address4 + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address5 + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address6 + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address7 + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address8 + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address9 + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: retired + verbose_name: null + is_dttm: false + is_active: true + type: BOOLEAN + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: date_created + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: date_changed + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: date_retired + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: parent_location + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: changed_by + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: location_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: retired_by + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: creator + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: location_tags + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: postal_code + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: state_province + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: city_village + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: retire_reason + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: county_district + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: latitude + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: name + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: description + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: country + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: longitude + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +version: 1.0.0 +database_uuid: 4e5f4045-a62d-4964-b719-58229a60e7fe diff --git a/distro/configs/superset/assets/datasets/Analytics/observations.yaml b/distro/configs/superset/assets/datasets/Analytics/observations.yaml new file mode 100644 index 0000000..9f011c0 --- /dev/null +++ b/distro/configs/superset/assets/datasets/Analytics/observations.yaml @@ -0,0 +1,413 @@ +table_name: observations +main_dttm_col: obs_date_time +description: null +default_endpoint: null +offset: 0 +cache_timeout: null +schema: public +sql: 'SELECT * FROM observations ' +params: null +template_params: null +filter_select_enabled: true +fetch_values_predicate: null +extra: null +normalize_columns: false +always_filter_main_dttm: false +uuid: add3064b-ce12-4f90-b374-d297159afccf +metrics: +- metric_name: count + verbose_name: COUNT(*) + metric_type: count + expression: COUNT(*) + description: null + d3format: null + currency: null + extra: null + warning_text: null +columns: +- column_name: obs_voided + verbose_name: null + is_dttm: false + is_active: true + type: BOOLEAN + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: visit_date_started + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: obs_date_time + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: visit_date_stopped + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: date_created + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: answer_datetime + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: answer_numeric + verbose_name: null + is_dttm: false + is_active: true + type: FLOAT + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: previous_version_obs_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: parent_obs_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: answer_drug + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: obs_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: form_namespace_and_path + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: obs_void_reason + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: answer_coded_uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: accession_number + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: question_label + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: answer_coded + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: creator_uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: location_uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: answer_complex + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: answer_modifier + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: patient_uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: answer_text + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: question_mapping + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: obs_uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: encounter_uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: encounter_type + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: question_uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: visit_uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: visit_type + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: location + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: comments + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +version: 1.0.0 +database_uuid: 4e5f4045-a62d-4964-b719-58229a60e7fe diff --git a/distro/configs/superset/assets/datasets/Analytics/orders.yaml b/distro/configs/superset/assets/datasets/Analytics/orders.yaml new file mode 100644 index 0000000..883a01d --- /dev/null +++ b/distro/configs/superset/assets/datasets/Analytics/orders.yaml @@ -0,0 +1,521 @@ +table_name: orders +main_dttm_col: encounter_datetime +description: null +default_endpoint: null +offset: 0 +cache_timeout: null +schema: public +sql: SELECT * FROM orders +params: null +template_params: null +filter_select_enabled: true +fetch_values_predicate: null +extra: null +normalize_columns: false +always_filter_main_dttm: false +uuid: 54ef1779-8dd1-4825-8cfc-89ce854051c6 +metrics: +- metric_name: count + verbose_name: COUNT(*) + metric_type: count + expression: COUNT(*) + description: null + d3format: null + currency: null + extra: null + warning_text: null +columns: +- column_name: care_setting_retired + verbose_name: null + is_dttm: false + is_active: true + type: BOOLEAN + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: encounter_type_retired + verbose_name: null + is_dttm: false + is_active: true + type: BOOLEAN + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: order_type_retired + verbose_name: null + is_dttm: false + is_active: true + type: BOOLEAN + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: encounter_voided + verbose_name: null + is_dttm: false + is_active: true + type: BOOLEAN + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: voided + verbose_name: null + is_dttm: false + is_active: true + type: BOOLEAN + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: auto_expire_date + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: date_activated + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: date_created + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: scheduled_date + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: encounter_datetime + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: date_voided + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: date_stopped + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: sort_weight + verbose_name: null + is_dttm: false + is_active: true + type: FLOAT + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: previous_order_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: order_type_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: order_group_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: care_setting + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: order_reason + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: patient_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: voided_by + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: concept_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: encounter_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: order_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: creator + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: orderer + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: order_type_java_class_name + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: order_reason_non_coded + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: care_setting_name + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: care_setting_uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: encounter_type_name + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: care_setting_type + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: order_type_name + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: encounter_type_uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: comment_to_fulfiller + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: order_type_uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: accession_number + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: order_action + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: void_reason + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: order_number + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: instructions + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +version: 1.0.0 +database_uuid: 4e5f4045-a62d-4964-b719-58229a60e7fe diff --git a/distro/configs/superset/assets/datasets/Analytics/patient_programs.yaml b/distro/configs/superset/assets/datasets/Analytics/patient_programs.yaml new file mode 100644 index 0000000..9bf779a --- /dev/null +++ b/distro/configs/superset/assets/datasets/Analytics/patient_programs.yaml @@ -0,0 +1,341 @@ +table_name: patient_programs +main_dttm_col: date_enrolled +description: null +default_endpoint: null +offset: 0 +cache_timeout: null +schema: public +sql: SELECT * FROM patient_programs +params: null +template_params: null +filter_select_enabled: true +fetch_values_predicate: null +extra: null +normalize_columns: false +always_filter_main_dttm: false +uuid: ad802192-8951-478d-8324-b0849f6429c7 +metrics: +- metric_name: count + verbose_name: COUNT(*) + metric_type: count + expression: COUNT(*) + description: null + d3format: null + currency: null + extra: null + warning_text: null +columns: +- column_name: program_retired + verbose_name: null + is_dttm: false + is_active: true + type: BOOLEAN + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: voided + verbose_name: null + is_dttm: false + is_active: true + type: BOOLEAN + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: date_created + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: date_changed + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: date_completed + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: date_voided + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: date_enrolled + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: program_outcomes_concept_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: patient_program_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: program_concept_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: outcome_concept_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: changed_by + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: location_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: patient_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: program_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: voided_by + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: creator + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: outcomes_concept_name + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: outcomes_concept_uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: program_name + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: concept_name + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: program_description + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: void_reason + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: program_uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: concept_uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +version: 1.0.0 +database_uuid: 4e5f4045-a62d-4964-b719-58229a60e7fe diff --git a/distro/configs/superset/assets/datasets/Analytics/patients.yaml b/distro/configs/superset/assets/datasets/Analytics/patients.yaml new file mode 100644 index 0000000..1eecf98 --- /dev/null +++ b/distro/configs/superset/assets/datasets/Analytics/patients.yaml @@ -0,0 +1,485 @@ +table_name: patients +main_dttm_col: birthdate +description: null +default_endpoint: null +offset: 0 +cache_timeout: null +schema: public +sql: 'SELECT * FROM patients ' +params: null +template_params: null +filter_select_enabled: true +fetch_values_predicate: null +extra: null +normalize_columns: false +always_filter_main_dttm: false +uuid: 34e209b6-fc04-4787-a892-9fd90fcf9bb3 +metrics: +- metric_name: count + verbose_name: COUNT(*) + metric_type: count + expression: COUNT(*) + description: null + d3format: null + currency: null + extra: null + warning_text: null +columns: +- column_name: address_10 + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address_11 + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address_12 + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address_13 + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address_14 + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address_15 + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address_1 + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address_2 + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address_3 + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address_4 + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address_5 + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address_6 + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address_7 + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address_8 + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address_9 + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: birthdate_estimated + verbose_name: null + is_dttm: false + is_active: true + type: BOOLEAN + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: person_voided + verbose_name: null + is_dttm: false + is_active: true + type: BOOLEAN + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: dead + verbose_name: null + is_dttm: false + is_active: true + type: BOOLEAN + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: date_created + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: death_date + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: birthdate + verbose_name: null + is_dttm: true + is_active: true + type: DATE + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: patient_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: creator + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: cause_of_death + verbose_name: null + is_dttm: false + is_active: true + type: INTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address_state_province + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address_county_district + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: person_void_reason + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address_latitude + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: family_name + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address_city + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address_country + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: address_longitude + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: middle_name + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: patient_uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: given_name + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: attributes + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: identifiers + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: gender + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +version: 1.0.0 +database_uuid: 4e5f4045-a62d-4964-b719-58229a60e7fe diff --git a/distro/configs/superset/assets/datasets/Analytics/sale_order_lines.yaml b/distro/configs/superset/assets/datasets/Analytics/sale_order_lines.yaml new file mode 100644 index 0000000..4ac9db0 --- /dev/null +++ b/distro/configs/superset/assets/datasets/Analytics/sale_order_lines.yaml @@ -0,0 +1,245 @@ +table_name: sale_order_lines +main_dttm_col: line_creation_date +description: null +default_endpoint: null +offset: 0 +cache_timeout: null +schema: public +sql: 'SELECT * FROM sale_order_lines ' +params: null +template_params: null +filter_select_enabled: true +fetch_values_predicate: null +extra: null +normalize_columns: false +always_filter_main_dttm: false +uuid: ca368613-61d0-47ec-a2ec-0e32d0fc2d51 +metrics: +- metric_name: count + verbose_name: COUNT(*) + metric_type: count + expression: COUNT(*) + description: null + d3format: null + currency: null + extra: null + warning_text: null +columns: +- column_name: unit_price + verbose_name: null + is_dttm: false + is_active: true + type: DECIMAL + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: subtotal + verbose_name: null + is_dttm: false + is_active: true + type: DECIMAL + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: quantity + verbose_name: null + is_dttm: false + is_active: true + type: DECIMAL + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: total + verbose_name: null + is_dttm: false + is_active: true + type: DECIMAL + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: line_last_modified_date + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: line_creation_date + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: sale_order_line_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: product_id + verbose_name: null + is_dttm: false + is_active: true + type: INTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: sequence + verbose_name: null + is_dttm: false + is_active: true + type: INTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: sale_order_name + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: product_external_id + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: product_name + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: customer_email + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: customer_name + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: invoicing_status + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: product_code + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: customer_uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: customer_phone + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +version: 1.0.0 +database_uuid: 4e5f4045-a62d-4964-b719-58229a60e7fe diff --git a/distro/configs/superset/assets/datasets/Analytics/visits.yaml b/distro/configs/superset/assets/datasets/Analytics/visits.yaml new file mode 100644 index 0000000..2c2804c --- /dev/null +++ b/distro/configs/superset/assets/datasets/Analytics/visits.yaml @@ -0,0 +1,257 @@ +table_name: visits +main_dttm_col: date_started +description: null +default_endpoint: null +offset: 0 +cache_timeout: null +schema: public +sql: 'SELECT * FROM visits ' +params: null +template_params: null +filter_select_enabled: true +fetch_values_predicate: null +extra: null +normalize_columns: false +always_filter_main_dttm: false +uuid: fefa8b10-bdf1-47b9-b081-89003c5e0583 +metrics: +- metric_name: count + verbose_name: COUNT(*) + metric_type: count + expression: COUNT(*) + description: null + d3format: null + currency: null + extra: null + warning_text: null +columns: +- column_name: patient_birthdate_estimated + verbose_name: null + is_dttm: false + is_active: true + type: BOOLEAN + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: patient_dead + verbose_name: null + is_dttm: false + is_active: true + type: BOOLEAN + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: visit_voided + verbose_name: null + is_dttm: false + is_active: true + type: BOOLEAN + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: patient_age_at_visit + verbose_name: null + is_dttm: false + is_active: true + type: DECIMAL + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: patient_death_date + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: date_started + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: date_stopped + verbose_name: null + is_dttm: true + is_active: true + type: DATETIME + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: patient_birthdate + verbose_name: null + is_dttm: true + is_active: true + type: DATE + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: visit_id + verbose_name: null + is_dttm: false + is_active: true + type: LONGINTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: patient_cause_of_death + verbose_name: null + is_dttm: false + is_active: true + type: INTEGER + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: visit_type_uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: visit_attributes + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: creator_uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: location_uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: patient_gender + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: patient_uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: visit_uuid + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: location + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +- column_name: type + verbose_name: null + is_dttm: false + is_active: true + type: STRING + advanced_data_type: null + groupby: true + filterable: true + expression: null + description: null + python_date_format: null + extra: null +version: 1.0.0 +database_uuid: 4e5f4045-a62d-4964-b719-58229a60e7fe diff --git a/distro/configs/superset/assets/metadata.yaml b/distro/configs/superset/assets/metadata.yaml new file mode 100644 index 0000000..a1c03dd --- /dev/null +++ b/distro/configs/superset/assets/metadata.yaml @@ -0,0 +1,3 @@ +version: 1.0.0 +type: SqlaTable +timestamp: '2024-06-11T03:56:43.263292+00:00' diff --git a/distro/configs/superset/client_secret.json b/distro/configs/superset/client_secret.json new file mode 100644 index 0000000..f3faf32 --- /dev/null +++ b/distro/configs/superset/client_secret.json @@ -0,0 +1,14 @@ +{ + "web": { + "issuer": "${KEYCLOAK_URL}/realms/ozone", + "auth_uri": "${KEYCLOAK_URL}/realms/ozone/protocol/openid-connect/auth", + "client_id": "${SUPERSET_CLIENT_ID}", + "client_secret": "${SUPERSET_CLIENT_SECRET}", + "redirect_urls": [ + "${SUPERSET_PUBLIC_URL}/*","http://localhost:8088/*" + ], + "userinfo_uri": "${KEYCLOAK_URL}/realms/ozone/protocol/openid-connect/userinfo", + "token_uri": "${KEYCLOAK_URL}/realms/ozone/protocol/openid-connect/token", + "token_introspection_uri": "${KEYCLOAK_URL}/realms/ozone/protocol/openid-connect/token/introspect" + } +} diff --git a/distro/configs/superset/security.py b/distro/configs/superset/security.py new file mode 100644 index 0000000..8a9a9a7 --- /dev/null +++ b/distro/configs/superset/security.py @@ -0,0 +1,58 @@ +from flask import redirect, request +from flask_appbuilder.security.manager import AUTH_OID +from superset.security import SupersetSecurityManager +from flask_oidc import OpenIDConnect +from flask_appbuilder.security.views import AuthOIDView +from flask_login import login_user +from urllib.parse import quote +from flask_appbuilder.views import ModelView, SimpleFormView, expose +import logging +logger = logging.getLogger(__name__) + +class AuthOIDCView(AuthOIDView): + def add_role_if_missing(self, sm, user_id, role_name): + found_role = sm.find_role(role_name) + session = sm.get_session + user = session.query(sm.user_model).get(user_id) + if found_role and found_role not in user.roles: + user.roles += [found_role] + session.commit() + + @expose('/login/', methods=['GET', 'POST']) + def login(self, flag=True): + sm = self.appbuilder.sm + oidc = sm.oid + + + @self.appbuilder.sm.oid.require_login + def handle_login(): + user = sm.auth_user_oid(oidc.user_getfield('email')) + if user is None: + info = oidc.user_getinfo(['preferred_username', 'given_name', 'family_name', 'email','roles']) + user = sm.add_user(info.get('preferred_username'), info.get('given_name'), info.get('family_name'), info.get('email'), sm.find_role('Gamma')) + role_info = oidc.user_getinfo(['roles']) + if role_info is not None: + for role in role_info['roles']: + self.add_role_if_missing(sm, user.id, role) + login_user(user, remember=False) + return redirect(self.appbuilder.get_url_for_index) + + return handle_login() + + @expose('/logout/', methods=['GET', 'POST']) + def logout(self): + + oidc = self.appbuilder.sm.oid + + oidc.logout() + super(AuthOIDCView, self).logout() + redirect_url = request.url_root.strip('/') + self.appbuilder.get_url_for_login + + return redirect(oidc.client_secrets.get('issuer') + '/protocol/openid-connect/logout?redirect_uri=' + quote(redirect_url)) + +class OIDCSecurityManager(SupersetSecurityManager): + authoidview = AuthOIDCView + def __init__(self,appbuilder): + super(OIDCSecurityManager, self).__init__(appbuilder) + if self.auth_type == AUTH_OID: + self.oid = OpenIDConnect(self.appbuilder.get_app) \ No newline at end of file diff --git a/distro/configs/superset/superset-init.sh b/distro/configs/superset/superset-init.sh index f51c1db..397e89c 100755 --- a/distro/configs/superset/superset-init.sh +++ b/distro/configs/superset/superset-init.sh @@ -39,12 +39,9 @@ if [ "$SUPERSET_LOAD_EXAMPLES" = "yes" ]; then fi echo_step "4" "Complete" "Loading examples" fi -echo_step "5" "Start" "Loading datasources" -superset import-datasources -p /etc/superset/datasources/datasources.yaml -echo_step "5" "Complete" "Loading datasources" -echo_step "6" "Start" "Updating dashboards" +echo_step "5" "Start" "Updating dashboards" superset import-directory /dashboards -f -o -echo_step "6" "Complete" "Updating dashboards" -echo_step "7" "Start" "Updating datasources" -superset set_database_uri -d $ANALYTICS_DATASOURCE_NAME -u postgresql://$ANALYTICS_DB_USER:$ANALYTICS_DB_PASSWORD@$ANALYTICS_DB_HOST:5432/$ANALYTICS_DB_NAME -echo_step "7" "Complete" "Updating datasources" \ No newline at end of file +echo_step "5" "Complete" "Updating dashboards" +echo_step "6" "Start" "Updating datasources" +superset set_database_uri --database_name $ANALYTICS_DATASOURCE_NAME --uri postgresql://$ANALYTICS_DB_USER:$ANALYTICS_DB_PASSWORD@$ANALYTICS_DB_HOST:5432/$ANALYTICS_DB_NAME +echo_step "6" "Complete" "Updating datasources" \ No newline at end of file diff --git a/distro/configs/superset/superset_config.py b/distro/configs/superset/superset_config.py index 14ff76a..48513b7 100644 --- a/distro/configs/superset/superset_config.py +++ b/distro/configs/superset/superset_config.py @@ -1,10 +1,16 @@ import logging import os +from dotenv import load_dotenv from cachelib import RedisCache +from cachelib.file import FileSystemCache logger = logging.getLogger() +def password_from_env(url): + return os.getenv("ANALYTICS_DB_PASSWORD") + +SQLALCHEMY_CUSTOM_PASSWORD_STORE = password_from_env def get_env_variable(var_name, default=None): """Get the environment variable or raise exception.""" @@ -29,8 +35,7 @@ def get_env_variable(var_name, default=None): DATABASE_PORT = get_env_variable("DATABASE_PORT", 5432) DATABASE_DB = get_env_variable("DATABASE_DB", "superset") -SQLALCHEMY_TRACK_MODIFICATIONS = get_env_variable( - "SQLALCHEMY_TRACK_MODIFICATIONS", True) +SQLALCHEMY_TRACK_MODIFICATIONS = get_env_variable("SQLALCHEMY_TRACK_MODIFICATIONS", True) SECRET_KEY = get_env_variable("SECRET_KEY", 'thisISaSECRET_1234') # The SQLAlchemy connection string. @@ -48,11 +53,9 @@ def get_env_variable(var_name, default=None): REDIS_CELERY_DB = get_env_variable("REDIS_CELERY_DB", 0) REDIS_RESULTS_DB = get_env_variable("REDIS_CELERY_DB", 1) -RESULTS_BACKEND = RedisCache( - host=REDIS_HOST, port=REDIS_PORT, key_prefix='superset_results') +RESULTS_BACKEND = RedisCache(host=REDIS_HOST, port=REDIS_PORT, key_prefix='superset_results') # RESULTS_BACKEND = FileSystemCache("/app/superset_home/sqllab") - class CeleryConfig(object): BROKER_URL = f"redis://{REDIS_HOST}:{REDIS_PORT}/{REDIS_CELERY_DB}" CELERY_IMPORTS = ("superset.sql_lab",) @@ -60,7 +63,6 @@ class CeleryConfig(object): CELERY_ANNOTATIONS = {"tasks.add": {"rate_limit": "10/s"}} CELERY_TASK_PROTOCOL = 1 - CACHE_CONFIG = { 'CACHE_TYPE': 'redis', 'CACHE_DEFAULT_TIMEOUT': 300, @@ -93,14 +95,6 @@ class CeleryConfig(object): SQLLAB_CTAS_NO_LIMIT = True PERMANENT_SESSION_LIFETIME = 86400 - -def password_from_env(url): - return os.getenv("ANALYTICS_DB_PASSWORD") - - -SQLALCHEMY_CUSTOM_PASSWORD_STORE = password_from_env - - class ReverseProxied(object): def __init__(self, app): @@ -122,4 +116,20 @@ def __call__(self, environ, start_response): ADDITIONAL_MIDDLEWARE = [ReverseProxied, ] ENABLE_PROXY_FIX = True -PREVENT_UNSAFE_DB_CONNECTIONS = False \ No newline at end of file +PREVENT_UNSAFE_DB_CONNECTIONS = False +# Enable the security manager API. +FAB_ADD_SECURITY_API = True + +if os.getenv("ENABLE_OAUTH") == "true": + from security import OIDCSecurityManager + from flask_appbuilder.security.manager import AUTH_OID + KEYCLOAK_URL = os.getenv('KEYCLOAK_URL') + SUPERSET_CLIENT_SECRET = os.getenv('SUPERSET_CLIENT_SECRET') + SUPERSET_URL = os.getenv('SUPERSET_URL') + AUTH_TYPE = AUTH_OID + OIDC_ID_TOKEN_COOKIE_SECURE = False + OIDC_REQUIRE_VERIFIED_EMAIL = False + AUTH_USER_REGISTRATION = True + AUTH_USER_REGISTRATION_ROLE = 'Gamma' + CUSTOM_SECURITY_MANAGER = OIDCSecurityManager + OIDC_CLIENT_SECRETS = '/etc/superset/client_secret.json' diff --git a/maven-archetype/src/test/resources/projects/it-basic/reference/scripts/.mvn/wrapper/maven-wrapper.properties b/maven-archetype/src/test/resources/projects/it-basic/reference/scripts/.mvn/wrapper/maven-wrapper.properties index fddca33..dac3682 100644 --- a/maven-archetype/src/test/resources/projects/it-basic/reference/scripts/.mvn/wrapper/maven-wrapper.properties +++ b/maven-archetype/src/test/resources/projects/it-basic/reference/scripts/.mvn/wrapper/maven-wrapper.properties @@ -1,2 +1,2 @@ -distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.7/apache-maven-3.9.7-bin.zip +distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.8/apache-maven-3.9.8-bin.zip wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar